Debian 8 resolv.conf overwritten by IPv6 autoconfiguration/DHCP when DHCP disabled

Do you have the rdnssd package installed? That runs a daemon which spawns shell scripts that certainly behave in the way you've described above.

Note that the dns-nameservers attribute on the interface only works with resolvconf.


You could monitor things to see what process is modifying the file

https://unix.stackexchange.com/questions/99074/find-which-process-is-modifying-a-file

If desired, temporarily you can edit resolv.conf and then

chattr +i /etc/resolv.conf

To prevent anything from modifying it


The best way I've found to solve this "issue" is installing resolvconf package.

sudo apt-get install resolvconf

After that, /etc/resolv.conf is replaced by a symbolic link to /etc/resolvconf/run/resolv.conf that is dynamically generated by resolvconf with the info from the file /etc/network/interfaces

Note that dns-nameserver entries in /etc/network/interfaces are ignored if you don't have resolvconf package installed in your system. You can find more info about the resolvconf package info in Debian wiki documentation or using man pages.

man resolvconf