I feel a need to blog about this today because it took several days to figure out, but the solution was trivial.
The scenario: my company has a Windows 2003 Domain Controller running DHCP, DNS and Active Directory services. We use an Untangle box as our gateway to the Internet. All of this works just great for Windows machines on the network, where everyone can use names like “host” to refer to each other’s machines.
However, the Linux boxes until now have been second-class citizens. They are able to get IP address via DHCP, but Windows knows nothing about their hostnames. Nearly all of our Linux boxen run CentOS 5, which is to say, Redhat 5 (RHEL).
The solution, it turns out, is two-fold:
On the Windows Domain Controller, go to the admin page for “Active Directory Users and Computers”. Under “Users” for your domain, create a new user named something like “dhcp4dns”. Pick a random password.
On the same machine, go to the admin tool for DHCP and right-click on your domain and select Properties. Click on the DNS tab and check everything, while also selecting “Always dynamically update DNS A and PTR records”. Then click on the Advanced tab and its Credentials… button. Here enter the details for the user you created in step 1.
This step is for CentOS: For every Linux box, edit the file
/etc/sysconfig/networking/devices/ifcfg-eth0(or whichever interface faces your local network).
Add the following line to that file, replacing hostname with your unqualified hostname:
DHCP_HOSTNAME=_hostname_
Now just reset networking on the Linux box:
# ifdown eth0 ; ifup eth0
Voila, your Windows server should now see the Linux box’s name just like everyone else on the network.


This is great, but doesn’t completely level the playing field. Windows computers can refer to each other by hostname, and now they can refer to the Linux boxes by hostname, but can the Linux boxes refer to the Windows machines by their hostnames?
I have been trying to find a solution for this problem for a while now, but it never seems to be addressed fully. To state the problem concisely, say you had a mix of notebooks running Windows and Linux that attach to and leave the network at random. You don’t have a “server”. All you have is a router that acts as DHCP server. The Windows machines seem to be able to get hostnames. You can look at the DHCP clients table in the router and see all the hostnames, but how do the Linux boxes get the hostnames of the other machines?
When I see the question asked, the answer is usually “make one of your Linux boxes into a local DNS server or DHCP server”, or “use static addresses”. Not the answer I’m looking for.
I would think that a useful feature of Windows that Linux doesn’t have would be an irresistable challenge for some smart coders, so a solution must be out there.