Page MenuHomeVyOS Platform

DNS Forwarder does not reload hosts file when modified.
Closed, ResolvedPublicBUG

Description

I have my DHCP server feeding into /etc/hosts. I have my DNS server forwarding dns, and also serving the contents of /etc/hosts.

The DNS server only gives out addresses that were in /etc/hosts when the dns forwarder was started, but doesn't pick up new ones.

Plug in wap-3c34. It shows in DHCP leases:

10.35.2.8        78:8a:20:0a:0e:c8  2018/05/24 14:58:59                            wap-3c34

But isn't available in DNS:

$ host wap-3c34
Host wap-3c34 not found: 3(NXDOMAIN)

If we do run restart dns forwarder on our firewall:

$ host wap-3c34
wap-3c34.admin.codethink.co.uk has address 10.35.2.8

Talking to @dmbaturin in IRC:

<dmbaturin> thinkl33t: Ok, now this is tricky. Since DHCPD doesn't execute anything when it gives a new lease (AFAIR), we'd have to teach pdns to re-read the hosts file for that.

Details

Difficulty level
Normal (likely a few hours)
Version
VyOS 1.2.0-rolling+201805210337
Why the issue appeared?
Will be filled on close

Event Timeline

pdns doesn't have a built-in reload (at least not available through systemd), but i've just tested and the following works:

sudo rec_control reload-zones

We can make a script that checks if service is configured and reload it if it's not then.

Thinking ahead: what happens when you have a very active DHCP server? Shouldn't we rate-limit reload-zones to max once/n sec ?

@EwaldvanGeffen Good point. Do you have ideas how to implement it?

syncer triaged this task as Normal priority.May 27 2018, 9:37 AM