DHCP not updating DNS

0

RHEL5.6, bind-9.3.6, and dhcp-3.0.5

So, after I fixed my problem with getting DHCP to parse the MAC addresses for these virtual machines, now I need to figure out how to get it to update DNS when one of those virtual hosts is up and active.

I've configured bind for dDNS and used nsupdate to verify named will accept dynamic updates.

I've configured DHCP to update its static leases and its pool. However, neither the dhcpd.log nor the named.log show any attempts at updating the DNS tables. On the other hand, the nsupdate tests show up in the named.log just fine.

So, I can verify that named will receive and accept updates, but I can't verify dhcpd is trying to send them.

The questions:

  • What might I have missed in my dhcpd.conf (or in /etc/sysconfig/dhcpd)?
  • Has anyone used log{} functionality in dhcpd.conf to confirm/refute dDNS updates?

Thanks!

Here are some dhcpd.conf snips:

ddns-update-style interim;
update-static-leases on;

key dhcpupdate
{
  algorithm hmac-md5;
  secret <KEY>;
}

zone 22.YYY.XXX.in-addr.arpa
{
  primary XXX.YYY.22.168;
  key dhcpupdate;
}

zone 23.YYY.XXX.in-addr.arpa
{
  primary XXX.YYY.22.168;
  key dhcpupdate;
}

zone 24.YYY.XXX.in-addr.arpa
{
  primary XXX.YYY.22.168;
  key dhcpupdate;
}

zone example.com
{
  primary XXX.YYY.22.168;
  key dhcpupdate;
}

zone sub1.example.com
{
  primary XXX.YYY.22.168;
  key dhcpupdate;
}

zone sub2.example.com
{
  primary XXX.YYY.22.168;
  key dhcpupdate;
}

zone sub3.example.com
{
  primary XXX.YYY.22.168;
  key dhcpupdate;
}

subnet XXX.YYY.24.0 netmask 255.255.254.0
{
  group
  {
    ddns-hostname "example.com";

    host <hostfqdn> { hardware ethernet <MAC>; fixed address <hostfqdn>;}
    ...
  }

  group
  {
    ddns-hostname "sub1.example.com";

    host <hostfqdn> { hardware ethernet <MAC>; fixed address <hostfqdn>;}
    ...
  }

  group
  {
    ddns-hostname "sub2.example.com";

    host <hostfqdn> { hardware ethernet <MAC>; fixed address <hostfqdn>;}
    ...
  }

  group
  {
    ddns-hostname "sub3.example.com";

    host <hostfqdn> { hardware ethernet <MAC>; fixed address <hostfqdn>;}
    ...
  }
}
subnet XXX.YYY.24.0 netmask 255.255.255.0
{
  option routers XXX.YYY.24.254;
  option domain-name-servers XXX.YYY.22.168, XXX.YYY.22.169;
  option ntp-servers XXX.YYY.22.168,XXX.YYY.22.169;
  default-lease-time 86400; # 1 day
  max-lease-time 604800;    # 7 days
  use-host-decl-names on;
  allow unknown-clients;

  option domain-name "example.com sub1.example.com sub2.example.com sub3.example.com";
  ddns-domainname "example.com";
  next-server XXX.YYY.22.159;
  filename "pxelinux.0";

  pool
  {
    allow members of "virtual-hosts";
    one-lease-per-client true;
    ping-check true;
    range XXX.YYY.24.11 XXX.YYY.24.60;
  }
}

dafydd

Posted 2012-11-22T00:12:11.850

Reputation: 472

Answers

1

And, the piece I was missing is on the client side. In RHEL5, I need to set DHCP_HOSTNAME to the host's short name for the dhclient to pass to the dhcpd daemon.

(Before I saw that text that specifies the short name, I tried with the FQDN. Now, I'll have to restart the DNS server to delete an accidental host.1.example.com.1.example.com, due to my dhcpd daemon not truncating the domain portion...)

dafydd

Posted 2012-11-22T00:12:11.850

Reputation: 472

0

On all the systems I have worked with, it has been the client's responsibility to update DNS. Most DHCP clients have a way to specify which DNS to notify.

If you are using bind, the default configurations I have worked with have had dynamic updates disabled.

For this kind of setup, I use dnsmasq to provide the DHCP and DNS services. It will update its DNS responses using the name provided in the DHCP request.

Even simpler is to use fixed IP addresses for the virtual machines. These can be added to DNS and will always be available. Most DHCP servers, including dnsmasq can provide fixed IP addresses based on the MAC address.

BillThor

Posted 2012-11-22T00:12:11.850

Reputation: 9 384

I may have to go with dnsmasq. The link I shared above and this one both suggest it should be possible to do from the server side.

– dafydd – 2012-11-26T16:47:32.690

The vast majority of my entries are fixed-address hosts. But, I need a pool for a set of virtual hosts that are being configured. The vhosts get static hostnames for their app. config files, but my DHCP/DNS provides the IP addresses as the vhosts are launched or retired. The weird thing is that I now see entries where DHCP has tried to update a couple of my fixed-address hosts. I'm looking at why those two are different... – dafydd – 2012-11-26T16:53:32.297

In my continued reading, I just read through the section titled "The Interim DNS Update Scheme" in the dhcpd.conf(5) man page. The paragraphs discussing allow client-update; vs. ignore client-update; describe exactly what I'm trying to do: DHCP takes a client-provided hostname and a pool IP address, and updates DNS dynamically.

– dafydd – 2012-11-26T17:19:33.343

Its been many years since I used a standalone DHCP server. It is good to see that they are working on getting it integrated with DNS. – BillThor – 2012-11-27T00:58:17.067