Using dnscache locally with FBSD 6.x

Mark Powell M.S.Powell at
Tue Aug 1 12:41:58 UTC 2006

   I want to put a local DJB dnscache on each host. This is primarily to 
improve reliabilty during network glitches. They will have cached most of 
our local addresses and will not hang if one of their dns servers 
   However, I use svscan to start up dnscache, and that starts very late in 
the boot. That means I can't just have the single "nameserver" 
line in resolv.conf, as every lookup would timeout until dnscache started. 
That means I need to replace resolv.conf early in the boot with the 
addresses of remote dns caches:

nameserver x.x.x.x
nameserver y.y.y.y

and then in dnscache's svscan startup file I can then put it back to:


I'm having difficulty finding the best place to make the former 
resolv.conf change to the remote dns servers.
   I initially tried /etc/rc.conf.local, but that gets sourced 16 times 
during bootup. That effectively forces resolv.conf to the remote dns 
servers, as it ust also be sourced after the dnscache has started up and 
overwrites the "nameserver" change that it makes when it starts 
   Anyone got a better place to put this?

Mark Powell - UNIX System Administrator - The University of Salford
Information Services Division, Clifford Whitworth Building,
Salford University, Manchester, M5 4WT, UK.
Tel: +44 161 295 4837  Fax: +44 161 295 5888 for PGP key

More information about the freebsd-questions mailing list