With the home server‘s hostname problem apparently resolved, I was able to access its Samba shares from Windows machines using the desired syntax (
\\jtown\...). (Configuring the shares will be the topic of the next posting.) However, I had difficulties connecting to the server by name with SSH.
A check of the administration GUI on my Verizon FiOS router, which also functions as a DNS and DHCP server, uncovered the issue: The router was still calling the server “new-host”! As a result, DNS lookups on “jtown,” the desired hostname, were failing.
A Wireshark review of traffic between the server and the router confirmed the underlying problem: the server was not including its hostname in its DHCP request for an IP address. So, the router was choosing to continue calling it “new-host.”
The Red Hat documentation looked like it would guide me to a solution. It includes a section on DHCP client configuration, which talks about a promising
DHCP_HOSTNAME option. The only problem was, the option belongs in a device configuration file in
/etc/sysconfig/network-scripts, but with NetworkManager handling my networking, there was no such file! How, then, to proceed?
The information in Red Hat bug #723374 put me on the path to a fix. If you’re facing the same problem I did, hopefully this approach will work for you, too.
If you’re using a networking device other than wired Ethernet on eth0, you’ll want to change the filename in step #1 accordingly.
- Create an
/etc/dhclient-eth0.conffile. (Putting the file in
/etc/dhcpworks, too, but unlike
/etc, non-root users can’t list that directory’s contents.) Creating the file while
su‘ed to root will give non-root users privileges to read it but not write to it, which is desirable.
- Setting up the file per the
manpage, write out a
send host-namestatement with the desired hostname (comments are supported with
# Added by D. Manchester, 2 May 2012
send host-name "jtown";
- Restart the NetworkManager service (
sudo service NetworkManager restart).
With that additional configuration file in place, Wireshark indicates that the server includes its hostname in its DHCP request. And indeed, the router now identifies the server correctly, and DNS lookups on “jtown” work!
Shares Accessible Even Without Fix?
The fact that the home server’s Samba shares were accessible via “jtown” even without this fix offers a useful reminder: While it apparently can work with DNS, SMB/CIFS, the protocol implemented by Samba, does not require DNS for name resolution. Rather, a client can discover a server via NetBIOS broadcast, and indeed, responding to such broadcasts is the primary purpose of Samba’s
Next: Configuring Samba!