dig +search <hostname_in_dhcp_lease> @<OPNSENSE_IP>
->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 55137;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 1
But is it expired or not. Pasting the entry here would certainly help reduce guesswork.Cheers,Franco
To reiterate, make sure that the entry exists in# cat /var/dhcpd/var/db/dhcpd.leasesand is valid (as in not already expired). Then make sure the entry exists in# cat /var/unbound/dhcpleases.confWhen doing a restart of Unbound there should be no issue that valid entries do not end up in this file if they exist in the former.Then, redo the testing to resolve the DHCP lease. If it doesn't work but it exists in both files the test was wrong. Sometimes domain mismatches can make this happen...Cheers,Franco
# cat /var/dhcpd/var/db/dhcpd.leases
# cat /var/unbound/dhcpleases.conf
The lease should show up in dhcpleases.conf once Unbound was restarted. The process to generate the file is:# pgrep -f unbound_dhcpd.py(should be up and running by showing a PID)This process will also log to the Unbound log:# opnsense-log resolverHere's how to restart it and watch the log file:# configctl -d unbound restart && opnsense-log -f resolverAny errors here related to the host in question?Cheers,Franco
# configctl -d unbound restart && opnsense-log -f resolver
Checking all packages: .......... donepy37-markupsafe has a missing dependency: python37py37-markupsafe has a missing dependency: py37-setuptoolspy37-markupsafe is missing a required shared library: libpython3.7m.so.1.0
ps aux | grep unbound
pgrep -f unbound_dhcpd.py
root 43084 0.0 0.2 25880 15192 - Ss 11:49 0:03.51 /usr/local/bin/python3 /usr/local/opnsense/scripts/dns/unbound_dhcpd.py --domain intern (python3.8)unbound 51803 0.0 0.6 95052 45708 - Ss 11:49 0:01.93 /usr/local/sbin/unbound -c /var/unbound/unbound.confroot 42113 0.0 0.0 12740 2356 0 S+ 11:54 0:00.00 grep unbound
root@router:~ # ps aux | grep unboundroot 61170 0.0 0.0 12892 2404 - Ss 13:14 0:00.00 /usr/local/bin/flock -n -E 0 -o /tmp/unbound_start.lock /usr/local/opnsense/scripts/unbound/start.shroot 61287 0.0 0.2 25880 14940 - R 13:14 0:00.26 /usr/local/bin/python3 /usr/local/opnsense/scripts/dns/unbound_dhcpd.py --domain intern (python3.8)root 61592 0.0 0.0 13500 2856 - S 13:14 0:00.00 /bin/sh /usr/local/opnsense/scripts/unbound/start.shroot 61729 0.0 0.3 36324 23248 - R 13:14 0:00.26 /usr/local/sbin/unbound-checkconf /var/unbound/unbound.confroot 61761 0.0 0.2 25880 14936 - Rs 13:14 0:00.03 /usr/local/bin/python3 /usr/local/opnsense/scripts/dns/unbound_dhcpd.py --domain intern (python3.8)root 62336 0.0 0.0 12740 2356 0 S+ 13:14 0:00.00 grep unbound
ps aux | grep unboundunbound 15633 0.0 3.8 389068 309596 - Ss 02:00 0:42.63 /usr/local/sbin/unbound -c /var/unbound/unbound.confroot 20113 0.0 0.0 12740 1964 0 S+ 11:31 0:00.00 grep unbound
ps aux | grep unboundroot 6264 0.0 0.2 25880 14568 - Ss 11:34 0:00.31 /usr/local/bin/python3 /usr/local/opnsense/scripts/dns/unbound_dhcpd.py --domain techservtn.com (python3.8)unbound 8438 0.0 0.5 110412 42400 - Ss 11:34 0:00.11 /usr/local/sbin/unbound -c /var/unbound/unbound.confroot 41524 0.0 0.0 12740 1964 0 S+ 11:34 0:00.00 grep unbound