Unbound as local DNS cacher, overwrite some domains

B.J.Scharp freebsd-questions at itsacon.net
Tue Oct 13 10:26:27 UTC 2015


Hello,

I have a setup where there are several machines on a LAN that have both
internal and external addresses. I would like to use Unbound as a local
DNS cacher that provides the internal address when queried, while the
external (authoritive) DNS gives the external address.

Example:

mail.example.org is on the LAN.

If a laptop is used on-site, the DHCP gives the FreeBSD server as the
primary DNS server.

That DNS server returns the LAN address when queried for
mail.example.org, but defers to a higher-up machine when queried for,
E.G., www.google.com

Next the laptop is taken out of the LAN, and when it queries the
external DNS for mail.example.org, it gets the WAN address for the
server. (for this reason I don't want to use the hosts file on the
laptop, nor use addresses like example.local).

So basically, I want Unbound to be authorative for some addresses, but
not necessarily for entire domains (not all hosts for the domain are on
that LAN, so for most queries, the normal authorative DNS can be used).
It's more like a LAN-wide hosts file.

Is this possible with Unbound, and if so, where do I start?

Regards,
Bernard


More information about the freebsd-questions mailing list