Installing the Operating System and Battling “new-host”

With the home server‘s BIOS up to date, it was time to install the operating system. Samba, which would be the server’s cornerstone, is available for most any variant of Linux, so I had a lot of leeway in picking a distribution.

My experiences with Ubuntu had been very good, so I could’ve gone with that. But, I wanted to get more exposure to other branches of the Linux family tree, so I chose version 6.2 of Scientific Linux, a Red Hat derivative.

The Scientific Linux installation generally came off smoothly. The one thing that behaved oddly afterwards was the system’s hostname.

Hostname Weirdness

Even though I had specified a meaningful hostname in the Scientific Linux installer, the system initially identified itself as “new-host”. Even odder, the name would sometimes change upon reboot: “new-host” became “new-host-2”, and then “new-host-3”; and after booting the system from an Ubuntu Live CD (but rebooting under Scientific Linux), it even called itself “ubuntu”!

Some poking around and Googling confirmed what was happening. The hostname I had entered into the installer hadn’t stuck. In its place, the system was accepting a hostname from my Verizon FiOS router (an Actiontec MI424WR)–the origin of the “new-host” names.

The Fix

Entering hostname

The fix was to use the system-config-network utility. On its DNS configuration screen, I entered my desired name into the Hostname field. To ensure the other parameters available on that screen were pulled down from my router, I blanked them out.

Upon rebooting, the login screen appeared with the correct hostname!

Update, 4 May 2012: While this fix got the home server identifying itself by the correct hostname, an additional fix was necessary to get our broadband router (and DNS server) to do the same. See “Battling ‘new-host,’ Round Two” for the details.

Some Notes on Configuring Linux Networking

  • Red Hat’s documentation asserts that, as of version 6.2, system-config-network is no longer needed, with its functionality subsumed by NetworkManager and its Network Connections GUI utility (nm-connection-editor). That assertion appears to be incorrect, though, as that GUI provides no ability to set the hostname. (Watch this space, though.)
  • Based on what find tells me (sudo find /etc -mmin -1 -print), files are updated as follows when I alter values on system-config-network‘s DNS configuration screen and save changes (default networking profile located in /etc/sysconfig/networking/profiles/default):
    This file in default profile updated… Updates pushed to…
    hosts /etc/hosts
    network /etc/sysconfig/network
    resolv.conf /etc/resolv.conf
  • system-config-network updates to the hosts files are purely additive; system-config-network will not remove old hostnames! So, if you name a system host1, but later change its name to host2, the relevant hosts lines will look something like:

    127.0.0.1     localhost.localdomain   localhost   host1  host2

    I don’t imagine this detritus would generally be harmful. Mostly, it just allows the host to ping/connect to itself via old hostnames–a capability of dubious value. I guess it could be problematic if an old hostname were assigned to a different machine and the hosts file were charged with name resolution for that machine, too. The file would then associate two different IP addresses with a single name, with unpredictable results.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s