Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have done research and can change the DNS server by editing /etc/resolv.conf, but it seems like every time I reboot the setting is overwritten by something else...
How can I stop whatever that edit the file?

share|improve this question
up vote 2 down vote accepted

If your network address is being set by DHCP, for example your DSL router hands it the address, the it is probably getting the DNS servers to use via DHCP too. In this case, change the DNS settings on what-ever device is handing out the addresses via DHCP is the better way to go as it means other machines/devices that you plug in will get the right ones too.

Edit: You can change what the DHCP client requests by updating its configuration file. I don't know exactly where this will be on a slackware install - on Debian and similar it is /etc/dhcp3/dhclient.conf. Find the request line and remove domain-name-servers. You will probably find more detail in man dhclient.conf assuming you have the man pages installed.

But if the name servers being given out by your router (or other DHCP server) are incorrect you should change the configuration there instead so you do not have to configure each client individually.

share|improve this answer
I suspect the same problem. Also DHCP clients can be explicitly told to not alter /etc/resolv.conf – geek Dec 12 '09 at 16:40
and how to tell them, geek? – phunehehe Dec 13 '09 at 1:21
yeah I did it, changed the DNS on my router and everything else works fine, thanks – phunehehe Dec 14 '09 at 14:16

Slackware Linux (at least 13.0) uses the dhcpcd DHCP client to get dynamic IPs, as you can see by studying /etc/rc.d/rc.inet1. Quote from the manpage of dhcpcd:

-R, --nodns
         Don't send DNS information to resolvconf or touch

However that option is not specified directly. Please see /etc/rc.d/rc.inet1.conf. Grep for the string DHCP_KEEPRESOLV. You must have that setting enabled for the config block corresponding to the correct network interface and its value must be "yes".

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .