23.1.7 - Unbound needs restart to register new DHCP names

Started by TimmiORG, May 05, 2023, 09:15:22 AM

Previous topic - Next topic
Hi,

I'm registering DHCP host names to the Unbound daemon to be able to resolve the host via their dhcp name.

Since the update to 23.1.7 I notice that I can see that the new dhcp names inside the leases but there are not able to get resolved by the unbound daemon.
A restart of Unbound is solving the issue.

Should I create a ticket in github directly or would this forum be sufficient?

Best regards
Christoph

I've seen this issue too -- even prior to 23.1.7. 

It just came up again this morning trying to connect to a dhcp client . A restart of unbound service resolves the issue immediately:


$ ping xxxxx
ping: xxxxx: Name or service not known


restart unbound


$ ping xxxxx
PING xxxxx.xxx.xx (xxx.xxx.xx.xxx) 56(84) bytes of data.


my DHCPv4 is set to default: 3600 / maximum 3660 . 

The client in this case was a Windows VM that has been up for 24+hrs.  I've seen this hit other libvirt VMs that I spin up  and down at different times.  Some names come back, and some don't.  I haven't been able to see a pattern.

--Michael

I hit this again today and was able to look into it a bit more.  In my case, it appears the unbound_watcher.py process is dying--I'm assuming this process should run continuously.


$ ps auxww | grep unb
unbound 28040   0.0  1.4  337936 232912  -  Ss   13:27       0:51.71 /usr/local/sbin/unbound -c /var/unbound/unbound.conf
root    13628   0.0  0.0   12752   2356  0  S+   19:27       0:00.00 grep unb


after a restart of the service:


ps auxww | grep unb
unbound  3865  56.9  1.4  323600 228148  -  Ss   19:28       0:01.29 /usr/local/sbin/unbound -c /var/unbound/unbound.conf
root     9160  14.0  0.1   25768  15548  -  Ss   19:28       0:01.56 /usr/local/bin/python3 /usr/local/opnsense/scripts/dhcp/unbound_watcher.py --domain some.domain (python3.9)
root    14811   0.0  0.0   12752   2356  0  S+   19:28       0:00.00 grep unb



$ w
7:33PM  up 5 days,  7:27, 1 user, load averages: 0.22, 0.28, 0.28


I see what appears to be restarts of unbound and the watcher in the logs--not sure why.  The last one at 13:27 with the watcher process demonized, but then as the ps above shows, the unbound process was still alive, but no active watcher process. 


2023-05-10T13:27:47-06:00 Notice unbound daemonize unbound dhcpd watcher.
2023-05-10T13:27:47-06:00 Notice unbound [28040:0] notice: init module 0: python


--Michael


Not trying to steal your topic, but this looks a lot like what I described here: https://forum.opnsense.org/index.php?topic=33846.0
In theory there is no difference between theory and practice. In practice there is.

A similar thing also happens with dnsmasq as the DNS: Leases registered by DHCP to the host name of the client are first included into DNS just fine, but once the client which is a test VM which is rebuilt quite often, using the *same* hostname registers again on DHCP using a different MAC address, the following happens:
- DHCP assignes the client a new IPv4 address based on the changed MAC
- The new IP address is NOT registered to the same hostname, dnsmasq keeps reporting the old IP address for the host name
This prevails until dnsmasq is restarted: Then the actual valid IP address is reported by dnsmasq res. DNS

This used to work in 22.7; it reminds me of the failures caused by "dhcpleases" in earlier versions of OPNsense.

Any ideas ?