2

I am using SUSE Linux and would like to know, what’s the difference between:

  ││[ ] Change Hostname via DHCP                                                                                                                                                 
  ││[x] Assign Hostname to Loopback IP 

Specifically, what happens if you check both or only check one? Such as when assigning a hostname and domain name with YaST? It seems like once you make a choice from YaST it cannot be changed again through YaST… At least on this specific item.

1 Answer 1

3

First, I don’t believe you can check both options to mix a localhost hostname with a DHCP-based hostname. But the specifics of the options you mention are well explained here; bold emphasis is mine:

If you are using DHCP to get an IP address, the hostname of your computer will be automatically set by the DHCP. You may want to disable this behavior if you connect to different networks, because they may assign different hostnames and changing the hostname at runtime may confuse the graphical desktop. To disable using DHCP to get an IP address uncheck Change Hostname via DHCP.

Assign Hostname to Loopback IP associates your hostname with 127.0.0.2 (loopback) IP address in /etc/hosts. This is an useful option if you want to have the hostname resolvable at all times, even without active network.

Knowing that it can be distilled like this:

  • Change Hostname via DHCP: This means that your hostname would be determined by what the DHCP server assigns you. Much like if you use an ISP that sets a hostname for your IP address each time you connect like user-1234.some_isp.somewhere.

  • Assign Hostname to Loopback IP: This would basically just edit the /etc/hosts file to set a hostname that will most likely be your computer name to your local loopback.

As far as personal preference goes, in my experience assigning the localhost loopback hostname via a setting in /etc/hosts is the way most systems work. Which is why—I assume—your configuration screen has that enabled by default.

The whole hostname via DHCP seems like an option one would setup for extremely non-permanent devices that one would not want to routinely access or check on remotely in any way. Just assign a hostname to make it easier to parse through DHCP than just looking at a pile of numbers. If anyone has any better ideas as to why DHCP hostnames would/should be preferable, please comment to explain the benefits; I can’t see the immediate benefit of something like that.

Then you ask this:

It seems like once you make a choice from YaST it cannot be changed again through YaST… At least on this specific item.

Perhaps that is the case. But honestly, Linux is Linux as and as explained on the YaST page itself this can be adjusted; bold emphasis is mine:

There are many supported networking types on Linux. Most of them use different device names and the configuration files are spread over several locations in the file system. For a detailed overview of the aspects of manual network configuration, see Section 21.6, Configuring a Network Connection Manually.

So there goes that; manual override is an option. While manual network configuration can seem daunting, honestly you should be able to adjust and change any network setting you might make in the future. All YaST—or any system configuration tool—would actually do is just tweak plaintext configuration files anyway. So if somehow you want a DHCP-based hostname in the future, read up on how to do that, make the adjustments and see what happens.

1
  • 3
    excellent answer. I can't fathom when or why you'd want the DHCP server, let's just say another server, to assign host names...but, different strokes for different folks... To me, that sounds confusing.
    – Thufir
    Mar 20, 2015 at 6:54

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .