1
20.7 Legacy Series / Unbound Host Overrides not Working with DHCP Leases for same IP
« on: November 23, 2020, 05:02:26 pm »
I've been spending quite some time in debugging host overrides for my internal network and I think I've finally tracked down the reason why they haven't been working (erratically).
When I add a host override for an existing ip address it appears that this entry is overridden by the dhcp lease entry that is also enabled (which is what I want).
An example:
I have the system set to automatically map dhcp leases. I also want to add an additional dns entry for one of the internal IPs (the reason being that there are multiple services that map to the same IP but are differentiated using SNI)
Having just the DHCP option turned on works fine for the actual hostname of the system.
Creating host overrides that reference the same IP address results in those additional hosts not returning a valid entry, if the local-zone is configured as static that results in NXDOMAIN if not it forwards the request further up. If the IP address in the host override does not match any DHCP lease then everything works as expected.
Interesting enough the reverse lookup continues to work fine and returns all the configured host overrides as well as the DHCP hostname entry.
Adding the local-data entries manually via a file in /var/unbound/etc which are loaded after the dhcp leases doesn't change the situation. I have absolutely no clue whats going on here. Unbound itself doesn't really help even at debugging level 5 there isn't really anything usable that is returned. It appears to me that having an entry that references the hostname of the system overrides all other entries (which makes no sense) maybe I'm also just doing something completely wrong, any help is appreciated.
When I add a host override for an existing ip address it appears that this entry is overridden by the dhcp lease entry that is also enabled (which is what I want).
An example:
I have the system set to automatically map dhcp leases. I also want to add an additional dns entry for one of the internal IPs (the reason being that there are multiple services that map to the same IP but are differentiated using SNI)
Having just the DHCP option turned on works fine for the actual hostname of the system.
Creating host overrides that reference the same IP address results in those additional hosts not returning a valid entry, if the local-zone is configured as static that results in NXDOMAIN if not it forwards the request further up. If the IP address in the host override does not match any DHCP lease then everything works as expected.
Interesting enough the reverse lookup continues to work fine and returns all the configured host overrides as well as the DHCP hostname entry.
Adding the local-data entries manually via a file in /var/unbound/etc which are loaded after the dhcp leases doesn't change the situation. I have absolutely no clue whats going on here. Unbound itself doesn't really help even at debugging level 5 there isn't really anything usable that is returned. It appears to me that having an entry that references the hostname of the system overrides all other entries (which makes no sense) maybe I'm also just doing something completely wrong, any help is appreciated.