Archive > 20.7 Legacy Series

Dynamic hosts from DHCP missing in /var/etc/dnsmasq-hosts

(1/1)

niziak:
Sometimes (very rare), I'm observing that I cannot resolve hostname which gets address from DHCP.
Hostname and its IP is  correctly shown on "leases" page. But file /var/etc/dnsmasq-hosts doesn't contain this host in section
--- Code: ---# dhcpleases automatically entered
--- End code ---

I just wondering how to reproduce this problem. Can you check if race is possible when  /var/etc/dnsmasq-hosts is generated (i.e. In case when two hosts refresh their leases in the same time) ?

thomas.schmid:
Hi,
The same here: dynamic addresses issued by DHCP server are listed in its "leases" file, but are not transfered to DNSmasq's "host" file, until 1) some unknown event happens or 2) we restart DNSmasq from OPNsense Web GUI.

The culprit is the "dhcpleases" service, which AFAIK is responsible for transferring the IP/FQDN entries from DHCP "leases" to DNSmasq "hosts". Today, one of our software engineers found out that "dhcpleases" a) is in all practicality unmaintained and b) could be "revived" by attaching "truss" to it for a short time, then detaching it again:

Looks like it repeatedly gets stuck in kqueue (after dhcpd cleans up its leases file, i.e. renames the old one and starts writing to a new one), but it's a Heisenbug, so as soon as you truss it, it resumes operation. So we just temporarily run truss on it and then terminate again.

Ugly, but it seems to work.

So, question: Anybody has a proper solution to this problem ?

Navigation

[0] Message Index

Go to full version