On 01/08/2015 10:11 AM, Peter Palfrader wrote:
... o remove all nameserver entries in /etc/resolv.conf and add one for the local recursor. Either manually or use (untested): sed -i -e 's/^nameserver /#&/; $a nameserver 127.0.0.1' /etc/resolv.conf o prevent anything else from modifying that file ever again: chattr +i /etc/resolv.conf ...
For what it's worth, most *nix OSs have files that are prepended and/or appended to /etc/resolv.conf, which are the intended way of doing this. They often come with corresponding man pages, too. OpenBSD has /etc/resolv.conf.tail, and Ubuntu has base, head, and tail in the /etc/resolvconf/resolv.conf.d directory.