Web lists-archives.com

Re: Why does resolv.conf keep changing?




> My /etc/resolv.conf looks like this:

> domain example.com
> search example.com.
> nameserver 127.0.0.1

Here's how I'd do it:
- install resolvconf
- move the resolv.conf config you use with bind to somewhere else, like
  /etc/resolv.conf.bind
- arrange for the script which starts your `bind` server to do:

      resolvconf -a lo.bind </etc/resolv.conf.bind

- furthermore arrange to run

      resolvconf -d lo.bind

  when bind is stopped.

`resolvconf` is designed to handle situations like these where there are
DNS configs from various places which all fight for the control of
/etc/resolv.conf.  The "lo.bind" is the name corresponding more or less
to the interface over which the info is served, and `resolvconf` uses
that info to enforce some priority between the different sources
of info.

With such a setup, your host should correctly use your local `bind`
server, and if you ever stop your `bind` server it should start using
your ISP's server instead.  And when you restart your `bind` server, it
will switch back to using that.


        Stefan