Sign up ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I set up /etc/resolv.conf

domain example.local

but,a days later..!?

It's changed!!

nameserver is DHCPD

How to stop change it?

share|improve this question

4 Answers 4

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.

share|improve this answer

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.

share|improve this answer

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 "";
supersede domain-name-servers, ;

this might look differently for other dhcp clients.

share|improve this answer

on my debian squeeze

open file: /etc/dhcp/dhclient.conf

$ sudo gedit /etc/dhcp/dhclient.conf 

remove comment from line:

# prepend domain-name-servers;


prepend domain-name-servers,;

note the trailing semicolon

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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