Changing DNS in network-admin

Loïc Martin loic.martin3 at gmail.com
Mon Oct 16 20:51:13 UTC 2006


Peter Garrett a écrit :
> 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
> 

Thanks for the information - I think you're describing exactly the
problem, except sadly my router doesn't have the option to turn it off.
Actually, I doesn't even advertise being a DNS - I think the way Windows
query the information from the router is different than Linux, because
else Netgear would have been in quite some trouble. I don't know the
difference.

/etc/resolv.conf had my router's local IP as a DNS. I've set the file to
be write protected (Dapper had a script in /etc/dhcp3 where I could
comment out the automatic query of the DNS adresses, but it's not in Edgy.

I guess not many people use Linux with that router (the same problem
happens with an Ethernet connection) else the "bug" might have been
pointed out. I don't know if it's worth a bug report (since the problem
seems to be the router, not Linux).

Loïc





More information about the ubuntu-users mailing list