Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 13 Oct 2015 11:57:08 +0100
From:      Arthur Chance <freebsd@qeng-ho.org>
To:        "B.J.Scharp" <freebsd-questions@itsacon.net>, freebsd-questions@freebsd.org
Subject:   Re: Unbound as local DNS cacher, overwrite some domains
Message-ID:  <561CE384.6040304@qeng-ho.org>
In-Reply-To: <561CD9FD.6020204@itsacon.net>
References:  <561CD9FD.6020204@itsacon.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On 13/10/2015 11:16, B.J.Scharp wrote:
> 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?

Take a look at the local-zone, local-data and local-data-ptr directives. 
You can totally override a zone or simply make changes and additions to 
one depending on the type specified in local-zone.

-- 
Those who do not learn from computing history are doomed to
GOTO 1



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?561CE384.6040304>