Linode Forum
https://forum.linode.com/

Linode Overwriting /etc/resolv.conf
https://forum.linode.com/viewtopic.php?f=19&t=4389
Page 1 of 1

Author:  chernevik [ Tue Jul 07, 2009 3:41 pm ]
Post subject:  Linode Overwriting /etc/resolv.conf

I've made changes to /etc/resolv.conf (to get a name server working), but my linode (running Debian 5.0) keeps replacing that with the linode installation's default.

How can I stabilize the file to my configuration? I'd like to either stop whatever is over-writing it, or have it over-written with the settings I need.

Thanks in advance.

Author:  mnordhoff [ Tue Jul 07, 2009 3:49 pm ]
Post subject: 

The DHCP client, dhclient3, is doing it. It gets a list of nameservers over DHCP and stuffs them in /etc/resolv.conf.

Why do you need a completely custom /etc/resolv.conf? What do you mean by "to get a name server working"?

I don't know how to get it to stop messing with /etc/resolv.conf completely. I do know that it's easy to get dhclient3 to prepend a custom server to the list -- see /etc/dhcp3/dhclient.conf. In the end, I stopped using DHCP, so I don't have to deal with it anymore. :D

Author:  chernevik [ Tue Jul 07, 2009 4:06 pm ]
Post subject: 

I'm running an authoritative name server for a domain of my own off the linode. I find that nslookup doesn't work properly if I don't set "domain" in resolv.conf to that of my domain, and remove the "search" directive in the linode default. I also have to add "nameserver 127.0.0.1" to the list of nameservers, and before any other nameserver directives.

I don't know how important that nslookup test is, but it's one of the diagnostics in "DNS and BIND" and I'm more comfortable having it work.

The manual shows a "supersede" statement that allows designation of values for options; perhaps I ought to use that.

Or, turn off dhcp entirely. Do I need it? I presume it's in the default installation for some reason.

Author:  mnordhoff [ Tue Jul 07, 2009 4:39 pm ]
Post subject: 

Ahh, right, you're the person from that other thread. :D

chernevik wrote:
I'm running an authoritative name server for a domain of my own off the linode. I find that nslookup doesn't work properly if I don't set "domain" in resolv.conf to that of my domain, and remove the "search" directive in the linode default. I also have to add "nameserver 127.0.0.1" to the list of nameservers, and before any other nameserver directives.


Ehh. You shouldn't need to put your authoritative server in /etc/resolv.conf. That's...really strange.

chernevik wrote:
I don't know how important that nslookup test is, but it's one of the diagnostics in "DNS and BIND" and I'm more comfortable having it work.


If "DNS and BIND" says something should work, it probably should, but that doesn't mean you're going about it the right way.

chernevik wrote:
The manual shows a "supersede" statement that allows designation of values for options; perhaps I ought to use that.


My old dhclient.conf contains:

Code:
supersede domain-name "mydomain.com";
prepend domain-name-servers 127.0.0.1;


among all of the other things.

(I run a local recursive nameserver.)

chernevik wrote:
Or, turn off dhcp entirely. Do I need it? I presume it's in the default installation for some reason.


It's up to you. DHCP configures your networking settings automatically. On a Linode, the settings will change so infrequently that you can set it up manually if you want to, but it's not necessary.

Author:  chernevik [ Tue Jul 07, 2009 4:56 pm ]
Post subject: 

mnordhoff wrote:
Ahh, right, you're the person from that other thread. :D


Yes. Hello.

Quote:
Ehh. You shouldn't need to put your authoritative server in /etc/resolv.conf. That's...really strange.


Well, I thought I needed it, but some experimentation shows I don't now, so perhaps the need was related to some other problem. And now that I look at it, the book says _don't_ use the local loopback address, so that's a fix. But without some reference to the local nameserver the result from the linode servers is "not authoritative".

Quote:
My old dhclient.conf contains:

Code:
supersede domain-name "mydomain.com";
prepend domain-name-servers 127.0.0.1;


I'll look into something like that, with a further option for the search directive. Turning off DHCP probably involves more research.

Thank you for your help.

Author:  hoopycat [ Tue Jul 07, 2009 5:39 pm ]
Post subject: 

chernevik wrote:
Well, I thought I needed it, but some experimentation shows I don't now, so perhaps the need was related to some other problem. And now that I look at it, the book says _don't_ use the local loopback address, so that's a fix. But without some reference to the local nameserver the result from the linode servers is "not authoritative".


That's fine -- that just means Linode's nameservers had to ask the domain's nameservers (that's you!) for the information, and as such, they merely have second-hand knowledge. This isn't a problem.

It's generally a good idea to keep your authoritative nameservers (the ones with the zone configurations) different than your recursive nameservers (the ones you put in resolv.conf), although for small installations, it doesn't matter too much. As God is my witness, however, when those small installations become large... :shock:

Author:  turb0chrg [ Tue May 11, 2010 2:09 pm ]
Post subject:  CentOS 5

Hey there.

Having the same issue with overwriting etc/resolv.conf on reboot on CentOS 5. I need to set a search directive for my domain.

It's defintely related to dhclient-script as resolv.conf looks like this:

Code:
; generated by /sbin/dhclient-script
search members.linode.com
nameserver 97.107.133.4
nameserver 207.192.69.5
nameserver 207.192.69.4


I don't have DHCP enabled in any of my /etc/sysconfig/network-scripts/ifcfg-* scripts either since I have a couple aliases setup.

Finally, I can't find any dhclient config files:

Code:
# find / -name dhclient*
./usr/share/man/man5/dhclient.leases.5.gz
./usr/share/man/man5/dhclient.conf.5.gz
./usr/share/man/man5/dhclient-eval.5.gz
./usr/share/man/man5/dhclient-options.5.gz
./usr/share/man/man8/dhclient.8.gz
./usr/share/man/man8/dhclient-script.8.gz
./usr/share/doc/dhclient-3.0.5
./usr/share/doc/dhclient-3.0.5/dhclient.conf.sample
./var/run/dhclient-eth0.pid
./var/lib/dhclient
./var/lib/dhclient/dhclient-eth0.leases
./sbin/dhclient-script
./sbin/dhclient


Anyone have any tips? Cheers!

Author:  jed [ Tue May 11, 2010 8:00 pm ]
Post subject:  Re: CentOS 5

turb0chrg wrote:
Anyone have any tips? Cheers!

yum remove dhclient (which probably isn't its name, which I'd find for you but...eh).

Author:  turb0chrg [ Wed May 12, 2010 12:18 pm ]
Post subject: 

That's exactly what it's called. I removed it and will reboot later to test it but I don't suspect any issues.

Thanks.

Page 1 of 1 All times are UTC-04:00
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/