# Best way to do a DNS cache for a LAN?



## RevennaFox (Sep 10, 2015)

I have a pretty good idea of what I want to do, but not really how to go about it. I have a FreeBSD 10.1 machine controlling a LAN, acting as a router, firewall, and DHCP server among other things.
What I'd like to do is run a DNS server on this machine that answers queries from the local network, where if the local server doesn't have the address or it's past its TTL, the local server queries an authoritative name server and stores that host data in its cache for the next time a local machine needs it.
I have some idea of how to do this, but I want to be certain I don't do something that will cause any security issues.


----------



## SirDice (Sep 10, 2015)

Have a look at unbound(8). It's part of the base OS on 10.x.


----------



## diizzy (Sep 13, 2015)

...or dnsmasq (ports) which is widely used in gateways/routers.
//Danne


----------

