DHCP is very unreliable (dhcp_host_domain_ng.py[]: Add_lease, hostname check failed)

Hi!

I have added few bridged Mikrotik bridged APs. When I try to connect trough them I got bunch of lines in Turris log that says:

2018-01-01T22:01:58+01:00 info dhcp_host_domain_ng.py[]: DHCPv4 new lease
**2018-01-01T22:01:58+01:00 warning dhcp_host_domain_ng.py[]: Add_lease, hostname check failed**

** 2018-01-01T23:01:58+01:00 warning dhcp_host_domain_ng.py[28933]: Last message ‘Add_lease, hostname ’ repeated 2 times, suppressed by syslog-ng on turris**
2018-01-01T22:01:58+01:00 info dhcp_host_domain_ng.py[]: DHCP remove old hostname [old,Honzas-iPad-2,10.37.20.129]
2018-01-01T23:01:58+01:00 debug dnsmasq-script[30521]: uci: Entry not found
2018-01-01T23:01:58+01:00 debug dnsmasq-script[30521]: __call_kresd hints.config(’/tmp/dhcp.empty’)
2018-01-01T22:01:58+01:00 info dhcp_host_domain_ng.py[]: Refresh kresd leases
2018-01-01T23:01:58+01:00 debug dnsmasq-script[30521]: ret > nil
2018-01-01T23:01:58+01:00 debug dnsmasq-script[30521]:
2018-01-01T23:01:58+01:00 debug dnsmasq-script[30521]: >
2018-01-01T23:01:58+01:00 debug dnsmasq-script[30521]: __call_kresd hints.add_hosts(’/tmp/kresd/hints.tmp’)
2018-01-01T23:01:58+01:00 debug dnsmasq-script[30521]: ret > [result] => true
2018-01-01T23:01:58+01:00 debug dnsmasq-script[30521]:
2018-01-01T23:01:58+01:00 debug dnsmasq-script[30521]: >
2018-01-01T22:02:01+01:00 info /usr/sbin/cron[30689]: (root) CMD (nethist_stats.lua)
2018-01-01T22:02:01+01:00 info /usr/sbin/cron[30688]: (root) CMD (/usr/bin/rainbow_button_sync.sh)
2018-01-01T22:02:07+01:00 info ucollect[3505]: Sending 225 flows
2018-01-01T22:02:07+01:00 info ucollect[3505]: Sending 934 IPv4 refused connections and 0 IPv6 ones
2018-01-01T23:02:07+01:00 info dnsmasq-dhcp[30521]: DHCPREQUEST(br-lan) 10.37.20.169 40:cb:c0:d6:4b:26
2018-01-01T23:02:07+01:00 info dnsmasq-dhcp[30521]: DHCPACK(br-lan) 10.37.20.169 40:cb:c0:d6:4b:26 Obyvaci-pokoj
2018-01-01T22:02:08+01:00 info dhcp_host_domain_ng.py[]: DHCPv4 new lease
2018-01-01T22:02:08+01:00 warning dhcp_host_domain_ng.py[]: Add_lease, hostname check failed
2018-01-01T23:02:08+01:00 warning dhcp_host_domain_ng.py[28933]: Last message ‘Add_lease, hostname ’ repeated 2 times, suppressed by syslog-ng on turris
2018-01-01T22:02:08+01:00 info dhcp_host_domain_ng.py[]: DHCP remove old hostname [old,Obyvaci-pokoj,10.37.20.169]
2018-01-01T23:02:08+01:00 debug dnsmasq-script[30521]: uci: Entry not found
2018-01-01T22:02:08+01:00 info dhcp_host_domain_ng.py[]: Refresh kresd leases
2018-01-01T23:02:08+01:00 debug dnsmasq-script[30521]: __call_kresd hints.config(’/tmp/dhcp.empty’)
2018-01-01T23:02:08+01:00 debug dnsmasq-script[30521]: ret >
2018-01-01T23:02:08+01:00 debug dnsmasq-script[30521]: __call_kresd hints.add_hosts(’/tmp/kresd/hints.tmp’)
2018-01-01T23:02:08+01:00 debug dnsmasq-script[30521]: ret >

I have tried also another bridged APs and I always got network working just part of the time. What should I do with this. Looks like a bug.

ref: https://gitlab.labs.nic.cz/turris/turris-os-packages/commit/0f6b2b7439cc5aece376eb1a2522353435e17289

“Hostname check failed” means that the name didn’t pass a regular expression and wasn’t added to local DNS. I don’t think this should affect anything but thatName.lan not getting resolved in DNS. /cc @paja.

Unfortunatelly this means that device will not get an DHCP address.

I have difficulty reproducing this. Even if the hostname is invalid, I will still get IP from DHCP. Do you have an example of that device hostname?

Does it work when you disable dynamic_domains?

uci set resolver.common.dynamic_domains = 0
uci commit resolver
/etc/init.d/resolver restart
3 Likes

Thank you!

This fixed DHCP issues I was having since an automatic update last year.

I am using Pi-Hole as a DNS and have disabled kresd and resolver and initially had to disable those two services after the update but DHCP was still not working reliably (some devices got an IP, some didn’t).

I can finally enable updates notifications again. :heart:

1 Like