Unbound is not registering new DHPC lease

Started by janci, September 28, 2021, 07:20:16 AM

Previous topic - Next topic
I did buy new pizero, configured it and connect to my VLAN.

I am not able to ping it using its name. e.g. ping pizero7 But I can see it in DHCPv4 -> leases list and can ping its IP. I am also able to ping another devices in that VLAN using their names, e.g.  ping pizero3.

I did switch off pizero3 and pizero7 for while so lease will expire. Then I did switch them on. I can ping pizero3 using its name but not pizero7. Only difference between those two devices is that pizero3 is connected to network for long time and pizero7 is new and this is first time it is connected to network.

On my linux laptop I am checking nslookup pizero3 and getting correct answert from OP. Checking pizero7 with nslookup I am getting NXDOMAIN

NOTE:
I am also running dnscrypt on OP and I did configured unbound to forward DNS query to dnscrypt.
see my comment https://forum.opnsense.org/index.php?topic=10670.msg118634#msg118634


Thanks for any help and tip ...

Is it pi zero wifi? Which wifi AP do you use?  Or do you use usb-RJ45 adapters?
kind regards
chemlud
____
"The price of reliability is the pursuit of the utmost simplicity."
C.A.R. Hoare

felix eichhorns premium katzenfutter mit der extraportion energie

A router is not a switch - A router is not a switch - A router is not a switch - A rou....

yes, it is pizero with wifi and I am using ubiquiti AP-AC-LR.
but as I did write, I can ping IP and I did test connetion for both pizeros and looks OK

ok, I did try usb ethernet adapter to connect pizero to network, problem remain ...
so I think it is not problem of wifi AP

September 29, 2021, 05:31:01 PM #4 Last Edit: September 29, 2021, 06:01:35 PM by janci
I think it is a bug.

After new device is connected to network, it is geting IP and I can see it in DHCPv4 leases list.
But file /var/unbound/dhcpleases.conf is not updated and that new device is not in it.

edit:
I did change existing and working device to static IP. Dhcp service was restarted and I did reconnect device.
I can see it in /var/unbound/host_entries.conf but file /var/unbound/dhcpleases.conf is again not updated

@janci
is "DHCP Registration" checkbox enabled in Unbound?
is unbound_dhcpd.py process running?
QuoteI can see it in /var/unbound/host_entries.conf but file /var/unbound/dhcpleases.conf is again not updated

static dhcp entries goes to host_entries.conf. dynamic - to dhcpleases.conf

September 30, 2021, 07:06:54 AM #6 Last Edit: September 30, 2021, 07:34:48 AM by janci
yes, both checkboxes  "Register DHCP leases" and "Register DHCP static mappings" are checked.

I did run this:
sudo ps -aux|grep unbound

and output is
/usr/local/sbin/unbound -c /var/unbound/unbound.conf

so unbound_dhcpd.py is not running
I am trying to findout the reason why it is crash to start but dont know which log file to check

Quotesudo ps -aux|grep unbound
sudo ps -auxww | grep _dhcpd.py
or just System: Diagnostics: Activity
if it's not there, can try to restart unbound

it is definitly not running
I did restart unbound, but not help.
While restarting I did see (run quickly ps ...) that it was starting ...

any error if you run
/usr/local/opnsense/scripts/dns/unbound_dhcpd.py --domain localdomain
in shell?

Can we get some sort of version number for baselining please...

#1
starting unbound_dhcpd.py from console as standart user failed with message "Unable to create the pidfile."
starting unbound_dhcpd.py from console as root (using sudo) started ok, and resolving is working ok too.

#2 OPNsense 21.7.3_1-amd64
and just check for updates and it is up to date

sorry, did not fully understand. when you start the unbound_dhcpd.py manually, client names are resolved and dynamic client records appear in dhcpleases.conf ?

I am ssh to router as standart user (not root).

so, when I did run unbound_dhcpd.py it said "Unable to create the pidfile."

BUT

if I did run sudo unbound_dhcpd.py then it is ok

yes, I understood this part)  but do the required entries appear in unbound after that?