I set up /etc/resolv.conf

domain example.local
nameserver 127.0.0.1
nameserver 192.168.1.108

but,a days later..!?

It's changed!!

nameserver 192.168.1.1

192.168.1.1 is DHCPD

How to stop change it?

link|improve this question

39% accept rate
feedback

3 Answers

Is the machine sourcing it's IP address from DHCP?

If so, resolv.conf will be turned over by the DHCP client, to reflect the details in the lease it receives.

Take a look at the manpage for the DHCP client you are using. For instance dhcpcd has a -R flag which prevents this behaviour.

link|improve this answer
feedback

Most likely you have a dhcp-client service setup on your machine, it is rewriting /etc/resolv.conf with values it receives from the dhcp server.

link|improve this answer
feedback

to prevent dhcp client rewriting your settings you can put as well in dhclient.conf [ /etc/dhcp3 in debian, if you use isc's dhcp3-client ]

supersede domain-name "your.domain.name";
supersede domain-name-servers 127.0.0.1, 192.168.1.108 ;

this might look differently for other dhcp clients.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.