Unbound DNS: Registering DHCP Leases and DHCP Static Mappings with VLANs?

Started by Sinister Pisces, October 28, 2023, 03:27:12 AM

Previous topic - Next topic
Hello,
I just enabled the static mapping registration so I can point at some stuff I'm self-hosting that has fixed IPs, and I'm really impressed with how those devices became accessible by their domain names almost instantly.
But I'm not at all familiar with using unbound, and now I'm curious about something. I. have VLANs on my network, and sometimes a device has multiple NICs and exists on more than one VLAN for legitimate reasons.
By default, OPNSense seems to use the same hostname for that host in each VLAN where it has an address.

How does unbound handle this? Will it just choke completely or do unpredictable things until I go in and adjust the domain names on each VLAN to get rid of the ambiguity?

If you set the DHCP Server a unique domain name per interface, the FQDNs will be unique. (I guess)

So for example you have:
lan.example.com
dmz.example.com
iot.example.com

Then a host "client" would be:
client.lan.example.com - 192.168.1.1
client.dmz.example.com - 192.168.2.1
client.iot.example.com - 192.168.3.1

Theres also the unbound static mapping file you can check to see if it does what you want.

cat /var/unbound/dhcpleases.conf
Hardware:
DEC740