Page 1 of 1

resolv.conf reset on reboot

PostPosted: August 27th, 2017, 3:13 pm
by satimis
Hi all,

Debian 9.1.0

$ sudo nano /etc/resolv.conf
adding
Code: Select all
nameserver      8.8.8.8
nameserver      8.8.4.4


$ sudo chattr +i /etc/resolv.conf
Code: Select all
chattr: Operation not supported while reading flags on /etc/resolv.conf


After reboot the entries on /etc/resolv.conf is reset with all entries deleted.

Please help. Thanks

Regards
satimis

Re: resolv.conf reset on reboot

PostPosted: August 29th, 2017, 10:12 am
by cynwulf
resolv.conf is often overwritten by dhclient, dhcpd, 'resolvconf' or some other software which provides DHCP client functionality (or itself calls dhclient).

Changing the file attributes may not work in Debian and probably isn't a viable option anyway now that Debian uses systemd.

Previously under sysvinit, setting the name servers in /etc/network/interfaces did the job, this was very Debian specific and I'm sure this file is not used anymore under systemd. You will need to configure this via whatever network management you have installed or via systemd's configuration. It's best to search the web, but don't bother with the Debian wiki as it's seems to be woefully out of date in this regard.

Re: resolv.conf reset on reboot

PostPosted: August 31st, 2017, 3:23 pm
by Monsie
Hello satimis,

It is likely that Network Manager is overwriting your dns settings to a default value. That being the case, just use the GUI in Network Manager to configure your dns server. Note that you will only be able set one server when using this method. To add the additional google server, you will need to prepend dhclient.conf Once either of these steps are done, you will see the final changes in resolv.conf

Hope this helps,
Monsie

Re: resolv.conf reset on reboot

PostPosted: August 31st, 2017, 3:29 pm
by satimis
Hi all,

Thanks for your advice.

Problem solved after installing resolvconf

Regards
satimis