IMO the proper way to display your current HOST and HOSTNAME values is to echo those variables as follows because AFAIK what is returned is how locally running apps will see those variables.
echo $HOST
echo $HOSTNAME
First, answering your “domain name” question…
That should actually be the group name of computers in your network. It’s the Domain name if you’re running something like LDAP or Active Directory, it is the Workgroup name if you’re not running network security. If this “domain” is not set correctly, then your machines will not be able to easily “see” and browse network services on another computer in your network, like network file shares, proxy authentication, more.
As for the HOST and HOSTNAME variables,
I just ran some tests on a LEAP 42.1 to verify what I’ve observed in the past…
Changing the HOSTNAME in YAST > Network Settings doesn’t always have an immediate effect in an open console, and I’ve always been curious about that… but if you wait a few minutes or open a new console immediately then you will see the HOSTNAME change in the console immediately.
But, if you use the “echo” methods I describe to display your current HOST and HOSTNAME, you will continue to see the original values. As I described, this is important because it will mean that apps dependent on reading these variables will be using values you thought had been changed.
Only after a full reboot,
Then when you run the echo tests again will you see the new values.
Also, technically the $HOST and $HOSTNAME variables can be different but it looks like openSUSE configures them both to always have the same values.
Lastly, note that when using YAST to change the Hostname what each checkbox does and their consequences…
Bottom line is that I highly recommend that the second checkbox should <always> be checked, and the first checkbox <only most of the time> the box should be unchecked (You would almost always check the box if you’re implementing network security like LDAP or AD).
The** first checkbox** “Change Hostname via DHCP” means just that… You’re allowing DHCP settings to over-ride whatever you just configured. <Uncheck> this box or nullify what you just set.
The **second checkbox **“Assign Hostname to Loopback IP” can be important for any applications that use “external” access using the loopback addresses (anything that starts with 127.0.0.x, that should answer your question about 127.0.0.1 and 127.0.0.2). When applications run on your machine, they can be using something like Sockets or Named Pipes that are internal direct access methods, or they can access by “external” network sockets.
But talking pipes and Unix sockets vs network sockets starts getting into a deep dive into system and software architecture. Just follow my recommendation any you’ll be OK… Until something doesn’t work and then you can post in these Forums again.
HTH,
TSU