Author Topic: Invalid hostname breaks reverse DNS lookup  (Read 1815 times)

dsla

  • Zen Apprentice
  • *
  • Posts: 8
  • Karma: +0/-0
    • View Profile
Invalid hostname breaks reverse DNS lookup
« on: August 30, 2016, 03:28:29 pm »
For future reference:

I've just solved a problem with my Zentyal 4.2 installation refusing to update any dynamic (DHCP) reverse DNS entries. The errors in syslog looked like this:
Code: [Select]
Aug 30 08:00:41 toby dhcpd: Added new forward map from firetvstick.tomh.sladden.com. to 192.168.2.33
Aug 30 08:00:41 toby dhcpd: Unable to add reverse map from 33.2.168.192.in-addr.arpa. to firetvstick.tomh.sladden.com.: SERVFAIL

After learning more than I ever wanted to know about both dhcpd and bind9 configuration, as well as apparmor relevant to Zentyal running in an lxc container, it turned out that the problem was a hostname defined within Zentyal under DNS->Domains->[domain]->Host names which had an underscore character in it. Deleting that hostname fixed it.

The debug was finally achieved by setting up comprehensive logging in named as per http://stackoverflow.com/questions/11153958/how-to-enable-named-bind-dns-full-logging and spotting the following in /var/log/named/general.log
Code: [Select]
30-Aug-2016 14:08:49.712 dns_rdata_fromtext: /var/lib/bind/db.2.168.192:14: near 'hp_p2015.tomh.sladden.com.': bad name (check-names)
30-Aug-2016 14:08:49.713 zone 2.168.192.in-addr.arpa/IN: loading from master file /var/lib/bind/db.2.168.192 failed: bad name (check-names)
30-Aug-2016 14:08:49.713 zone 2.168.192.in-addr.arpa/IN: not loaded due to errors.

Dan