I have setup a DNS server for my department which is running FreeBSD 10.2. It is currently connected to the campus internet and receiving its address via dhcp, so /etc/resolv.conf looks like this:
#Generated by resolvconf
search ttu.edu
nameserver x.x.x.x
nameserver x.x.x.x
I need the first nameserver to be 127.0.0.1. Therefore, I put the following in /etc/dhclient.conf:
interface "igb0" {
prepend domain-name-servers 127.0.0.1;
}
However, now /etc/resolv.conf gets entirely rewritten and the only thing left is:
#Generated by resolvconf
nameserver 127.0.0.1
Why did everything else go away and how do I prepend the local dns server without losing everything else?
/etc/resolvconf.conf
. Looking at the man page, it seems to have a similar function that might work for you./etc/hosts
gets checked before trying with any DNS server. Unless they all have set up a slave server (which wouldn't be the best way to do it), I would recommend you to just run a script through the whole network when there are changes so you update/etc/hosts