Changing DNS in network-admin

Peter Garrett peter.garrett at optusnet.com.au
Sun Oct 15 01:10:07 UTC 2006


On Sat, 14 Oct 2006 20:30:56 +0200
Loïc Martin <loic.martin3 at gmail.com> wrote:

> I connect to the internet through a Netgear router. The problem is,
> network admin wrongly detects its address as a DNS, 

Probably not network admin - I suspect your router is giving out wrong
information - see below.

> and even when I
> change the DNS, putting the ones my router tells me (they work) sooner
> than later it reverts back to the router address (thus no browsing, even
> no sending emails...).

What is the content of the /etc/resolv.conf  file when this happens? Do you
have an entry in that file that looks like

search domain.invalid

or similar, or just a couple of "nameserver" lines? Usually this
behaviour, in my experience, is related to DHCP - each time DHCP queries
the router it overwrites /etc/resolv.conf . Normally this can be
configured in the router. If the "search" line is present, the system will
look for a nameserver on the local network, which you don't want it to
do...  since apparently your router will not relay DNS requests properly,
but for some reason it is still being identified as a DNS server, which
as far as I can work out would only happen if the router "thinks" it has
a DNS server on board and is "telling" your system so.

A rather inelegant ( hackish) solution is to remove write permissions
from /etc/resolv.conf , after setting your nameserver IPs correctly. of
course.

sudo chmod -w /etc/resolv.conf

( you can reverse that with  "sudo chmod u+w /etc/resolv.conf"  if
necessary )

If  /etc/resolv.conf is not writeable, it won't change - which is fine as
long as your nameservers don't change ! Usually your ISPs nameservers will
remain the same though, so that should not be a problem.

This may not be the issue - I'm just making suggestions. Perhaps someone
using a Netgear router will have a better answer. My router has a
configuration option that allows me to "turn off" using it as a DNS server
- no idea what options exist for yours.

Peter




More information about the ubuntu-users mailing list