I've got dhcpd pushing updates to bind, and it seems to be working fine:
named[24161]: client 192.168.10.1#59141: signer "dhcp_updater" approved
named[24161]: client 192.168.10.1#59141: updating zone 'office.lan/IN': adding an RR at 'Examples-MBP.office.lan' A
named[24161]: client 192.168.10.1#59141: updating zone 'office.lan/IN': adding an RR at 'Examples-MBP.office.lan' TXT
named[24161]: client 192.168.10.1#47923: signer "dhcp_updater" approved
named[24161]: client 192.168.10.1#47923: updating zone '10.168.192.in-addr.arpa/IN': deleting rrset at '7.10.168.192.in-addr.arpa' PTR
named[24161]: client 192.168.10.1#47923: updating zone '10.168.192.in-addr.arpa/IN': adding an RR at '7.10.168.192.in-addr.arpa' PTR
However, our MacBooks are often on WiFi and plugged in via ethernet at the same time. This means that bind rejects the update, because of duplicate hostnames:
named[24161]: client 192.168.10.1#34165: updating zone 'office.lan/IN': update unsuccessful: Examples-MBP.office.lan: 'name not in use' prerequisite not satisfied (YXDOMAIN)
named[24161]: client 192.168.10.1#35832: updating zone 'office.lan/IN': update unsuccessful: Examples-MBP.office.lan/TXT: 'RRset exists (value dependent)' prerequisite not satisfied (NXRRSET)
I don't actually care too much about the forward lookup, I just want the reverse lookup on both IPs, so that both IP addresses point to the same hostname.
Here's the relevant part of dhcpd.conf
:
ddns-update-style interim;
ddns-domainname "office.lan.";
ddns-rev-domainname "in-addr.arpa";
key DHCP_UPDATER { algorithm hmac-md5; secret "{{secret key}}"; };
zone 10.168.192.in-addr.arpa. { primary 192.168.10.2; key DHCP_UPDATER; }
zone office.lan. { primary 192.168.10.2; key DHCP_UPDATER; }
and the relevant parts of named.conf.local
:
zone "office.lan" IN {
type master;
file "/var/lib/bind/office.lan.db";
allow-update { key DHCP_UPDATER; };
};
zone "10.168.192.in-addr.arpa" {
type master;
file "/var/lib/bind/10.168.192.in-addr.arpa";
allow-update { key DHCP_UPDATER; };
};
I tried commenting out the zone office.lan.
and ddns-domainname
lines in dhcpd.conf
, but then I was just getting these error messages:
dhcpd: Unable to add forward map from Examples-MBP.office.lan. to 192.168.10.7: timed out
So the question is: How can I get dhcpd to just update the records in 10.168.192.in-addr.arpa
, and not worry about duplicate hostnames in office.lan.db
? Alternatively, is there some way to ignore duplicate hostnames, or alter the hostnames to make them unique?
Please let me know if you need any further information.
I've found a good solution. I just put our Wifi devices on a different VLAN, so that I could configure a different dynamic DNS domain for that subnet.
So now a reverse lookup for a wifi client IP returns
<hostname>.wifi.lan
, and a wired client returns<hostname>.office.lan
.