Showing posts with label dhcp. Show all posts
Showing posts with label dhcp. Show all posts

Monday, October 27, 2014

Dude, where's my A record?

I ran into something a bit odd today while setting up a couple of new CentOS 6.5 virtual machines.  The VM's were both set to receive IP addresses via Windows DHCP, which was working except for one small bit.  That particular DHCP scope is set to dynamically create both forward (A) and reverse (PTR) records when a lease is obtained.  Oddly, this was not happening.  Being a Linux admin, I immediately thought, "must be Windows!"

After digging into the Windows side of the house, I was left scratching my head.  All of the settings for both DHCP and DNS were as they should be.  I set up a packet capture and sent a few DHCP requests from the VM's which revealed the issue.  The default behavior for dhclient in CentOS now is to not pass the hostname in the request.  Adding one simple parameter in the /etc/sysconfig/network-scripts/ifcfg-eth0 file solved everything.  If you run into this issue, simply add the following to the file for the affected interface:
DHCP_HOSTNAME=`hostname -s`
 By including this line, you are telling dhclient to pass the hostname to the DHCP server in the request.