Local authoritative DNS on OpenBSD using dhcpd(8) and unbound(8)

submited by
Style Pass
2022-01-14 08:00:06

One meaningful addition to home networks is the ability to refer to devices using domain names instead of IP addresses. Domain names are more memorable and human readable. Local authoritative DNS allows things like this to work:

Understand that this document makes some assumptions. Primarily, that there is a router running OpenBSD that serves DHCP and DNS with dhcpd(8) and unbound(8). Local authoritative DNS is an extension to this setup.

Often people will choose a domain name for their home network on a whim, something like localdomain or lan. I used lan for a while. It turns out there is a special-use domain name explicitly reserved for this purpose: home.arpa. (Check out RFC8375 for more information).

Unbound is mostly known as a caching recursive resolver. However, it can also serve zones authoritatively,1 as indicated by this commented out section in the default configuration file.

I prefer to include a separate file in unbound.conf(5) so that this part of the configuration is distinct. Edit /var/unbound/etc/unbound.conf and place the desired file name in there somewhere.

Leave a Comment