[Linux-disciples] Resolv.conf, straw, etc.

Adam Rosi-Kessel adam at rosi-kessel.org
Wed Dec 29 15:19:50 EST 2004


resolv.conf is dynamic; you don't need to restart anything to have
changes made to resolv.conf take effect.

Your DHCP client gets DNS information when it receives an IP address from
the DHCP server.  Usually, the router is a DNS (regardless of whether it
is wired or wireless), so it gives itself as the DNS IP.
Addresses listed in /etc/resolv.conf is where linux looks up hostnames.

If you delete resolv.conf, then you don't have any nameservers specified.
I'm not sure how DNS lookup would then occur--this probably explains why
your networking is screwy when you delete that file.

Usually you don't have to worry about any of this--you do ifup in your
current environment, and the correct nameserver IP is inserted into
/etc/resolv.conf by dhclient.  I'm not sure why that doesn't just work
for you.

Many ISP's nameservers won't accept connections from outside their
network, so you probably can't set your home ISP DNS server as your
permanent nameserver in resolv.conf.  There are some open
nameservers--for example, I use some at Harvard--but usually it works
just fine to use whatever nameservers are given to you by your local DHCP
server.

If you don't want dhclient to overwrite resolv.conf with the settings
given by the DHCP server, there is an option for dhclient that prevents
it from using the DNS given by the DHCP server.  I can't find that option
in a quick scan of the manpage, but I'm sure you could google it.  I used
to use it before I decided to stop worrying and love the DHCP server.

On Wed, Dec 29, 2004 at 01:08:24PM -0500, Stephen R Laniel wrote:
> When I go to particular WiFi hotspots -- namely the
> NewburyOpen.net -- someone adds lines to my /etc/resolv.conf
> file listing newburyopen.net as a nameserver. Thereafter,
> even if I leave newburyopen.net, my networking is all messed
> up. I delete /etc/resolv.conf, restart
> /etc/init.d/networking, and so forth. Some programs are
> still messed up -- particularly straw. I gather that the
> resolv.conf info is cached somewhere, but I'm not sure
> where.
> 
> I'm surprised that using a hotspot messes things up this
> much. What I'd expect is that my machine would send out a
> DHCP broadcast, and would get a response from
> newburyopen.net that includes the IP addresses of domain
> name servers. As soon as it leaves newburyopen.net, it again
> tries to get a DHCP lease; this time the lease comes from
> another host, which sends a different set of DNS servers
> back.
> 
> What am I misunderstanding? And how can I avoid future
> problems with resolv.conf?
-- 
Adam Rosi-Kessel
http://adam.rosi-kessel.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://lists.bostoncoop.net/pipermail/linux-disciples/attachments/20041229/b40ac410/attachment.pgp


More information about the Linux-disciples mailing list