# name resolution issue

## tigerfish66

I have a static ip address assigned to my gentoo pc from my local lan, the internet connection is provided via an ADSL router, all the other lan workstations work fine but are different distros and a mac, however the gentoo pc can't resolve host names on the internet, please see the output of various command below for tech details, the auto-generated resolv.conf seems fine

tail /etc/conf.d/net

# This blank configuration will automatically use DHCP for any net.*

# scripts in /etc/init.d.  To create a more complete configuration,

# please review /etc/conf.d/net.example and save your configuration

# in /etc/conf.d/net (this file :]!).

# dns_domain_eth0="csynet.co.uk"

#dns_servers_eth0="192.168.0.1"

config_eth0=( "192.168.0.10 netmask 255.255.255.0 brd 192.168.0.255" )

routes_eth0=( "default via 192.168.0.1" )

dns_servers_eth0="192.168.0.1"

 ifconfig

eth0      Link encap:Ethernet  HWaddr 00:0d:87:36:d7:c7  

          inet addr:192.168.0.10  Bcast:192.168.0.255  Mask:255.255.255.0

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

          RX packets:330 errors:0 dropped:0 overruns:0 frame:0

          TX packets:157 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000 

          RX bytes:41204 (40.2 KiB)  TX bytes:13607 (13.2 KiB)

          Interrupt:11 Base address:0xd400 

lo        Link encap:Local Loopback  

          inet addr:127.0.0.1  Mask:255.0.0.0

          UP LOOPBACK RUNNING  MTU:16436  Metric:1

          RX packets:45 errors:0 dropped:0 overruns:0 frame:0

          TX packets:45 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:0 

          RX bytes:810 (810.0 B)  TX bytes:810 (810.0 B)

tail /etc/resolv.conf

# Generated by net-scripts for interface eth0

nameserver 192.168.0.1

db ~ # ping 192.168.0.1

PING 192.168.0.1 (192.168.0.1) 56(84) bytes of data.

64 bytes from 192.168.0.1: icmp_seq=1 ttl=255 time=0.773 ms

64 bytes from 192.168.0.1: icmp_seq=2 ttl=255 time=0.758 ms

64 bytes from 192.168.0.1: icmp_seq=3 ttl=255 time=0.759 ms

^C

--- 192.168.0.1 ping statistics ---

3 packets transmitted, 3 received, 0% packet loss, time 2003ms

rtt min/avg/max/mdev = 0.758/0.763/0.773/0.023 ms

db ~ # ping 195.112.4.14

PING 195.112.4.14 (195.112.4.14) 56(84) bytes of data.

64 bytes from 195.112.4.14: icmp_seq=1 ttl=53 time=18.8 ms

64 bytes from 195.112.4.14: icmp_seq=2 ttl=53 time=18.6 ms

64 bytes from 195.112.4.14: icmp_seq=3 ttl=53 time=19.1 ms

64 bytes from 195.112.4.14: icmp_seq=4 ttl=53 time=18.5 ms

^C

--- 195.112.4.14 ping statistics ---

4 packets transmitted, 4 received, 0% packet loss, time 3026ms

rtt min/avg/max/mdev = 18.535/18.793/19.110/0.252 ms

db ~ # ping ntp.nildram.co.uk

ping: unknown host ntp.nildram.co.uk

----------

## cwr

I've been bitten by a router that pretended to be nameserver but didn't actually

serve names - I think it was a DLink, but which version is long forgotten.  (It

worked with Windows machines on the same net, btw.)

Try editing resolv.conf to set another nameserver; OpenDNS is annoying, but

should work.

Will

----------

## rainer

Editing /etc/resolv.config will not work because it is overwritten every time with the content of /etc.conf.d/net - that's where the nameserver is read from.

If you put

```
dns_servers_eth0=( "208.67.222.222" "208.67.220.220" )
```

there (or the name servers of your provider), you should be OK.

Rgds,

Rainer

----------

## cwr

 *rainer wrote:*   

> Editing /etc/resolv.config will not work because it is overwritten every time with the content of /etc.conf.d/net - that's where the nameserver is read from.
> 
> 

 

Fair enough, but it worked for me.  I  don't know under what conditions resolv.conf is overwritten,

but it's certainly not on every reboot.

Will

----------

## cach0rr0

 *cwr wrote:*   

> 
> 
> Fair enough, but it worked for me.  I  don't know under what conditions resolv.conf is overwritten,
> 
> but it's certainly not on every reboot.
> ...

 

If setting nameserver in /etc/conf.d/net, it should be every time net.eth0 init script is run AFAIK

DHCP is another matter, that doesn't apply here

----------

## cwr

Yes, digging around it looks as if /etc/conf.d/net is the only way to overwrite

resolv.conf, although one of the dhcp clients might do it as well.  However,

dhclient doesn't - my resolv.conf is dated May 2009.

Will

----------

## tigerfish66

Rainer,

Thanks for your reply, but as you can see from my original post the /etc/conf.d/net has the required DNS entry. Thats why i am really puzzled.

Tigerfish

----------

## tigerfish66

Guys,

I chnaged to opendns servers from my router and everything worked, thanks for all your help, obviously linksys have work to do on their adsl-routers.

Tigerfish

----------

