# Can ping using IP address but not using FQDN[solved]

## sdia

Few weeks back I managed to setup dual boot on my HP Pavilion zt3010us laptop with XP and Gentoo. I simply want to get rid of Microsoft but the Linux (Gentoo  :Sad:   is not making it easy for me. Here is the problem, I have a SpeedTouch router with ADSL connection at home and I have set it up using a CD that came with router. Router is configured and is setup as a dhcp server...thats fine. When I boot into XP, machine gets the IP address from the router automatically and everything is fine... I am able to access internet no problem...

But when I boot into my Gentoo and use dhcp to get IP from my router it get all the required information successfully and is exactly same info as with running XP. It creates correct DNS entry in /etc/resolv.conf and then IP is correct as well. But I am only able to access internet using IP addresses not with the FQDN...

I have tried several thing to get it working but with no success...

- My XP works fine even when I hook into network with static IP (obviously with same IP, DNS, GW that it gets using DHCP setup).

- When I try to do same with Gentoo and provide the required information in /etc/conf.d/net and /etc/resolve.conf and then when I start eth0 using /etc/init.d/net.eth0 start ... it fails to setup gateway information somehow... with static IP its worse coz I am not able to ping at all... it says network not reachable!

On the other hand, I am able to hook my Gentoo into my work-place network using static IP with required network details and everything is fine... no problems at all. 

But I want to use my gentoo when i am home as well...

I have been trying to fix this for weeks now and with no sucess... finally am here with my problem with a hope to get some tips/help. Thank you.Last edited by sdia on Mon Oct 24, 2005 6:05 pm; edited 1 time in total

----------

## saturas

for dhcp settings:

first make shoure that you have no other settings in /etc/conf.d/net then this one 

iface_eth0="dhcp"

you can comment all others. then try /etc/init.d/net.eth0 restart

for IP static problem

when you setup the static ip address did you set your nameserver in /etc/resolv.conf ?

if yes, does it reply to a ping? if yes, try the command nslookup www.yahoo.com for example.

----------

## sdia

when I try with dhcp setting, I dont specify anything at all in /etc/conf.d/net coz dhcp is assumed as default. 

And when I try with static IP I do make sure I provide proper DNS information in /etc/resolv.conf and IP and gw info in /etc/conf.d/net respectively. With static IP setting I am not able to ping altogether neither with IP address or with FQDN.

----------

## Chris W

If you can ping remote IP addresses then the default routes must be correct.  Not being able to resolve addresses from names means that either /etc/resolv.conf is broken on the Gentoo box, or the details given by the DHCP server (if any) are wrong.  Most of these devices act as a DNS proxy/server and will send their own address as the DNS server, but if they aren't they will forward your ISP's DNS addresses.  You can test this DNS facility directly with the host command from net-dns/bind-tools with something like: 

```
chrisw@newton ~ $ host -v www.somewhere.com 192.168.1.1

Trying "www.somewhere.com"

Using domain server:

Name: 192.168.1.1

Address: 192.168.1.1#53

Aliases:

;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 18535

;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 4, ADDITIONAL: 4

;; QUESTION SECTION:

;www.somewhere.com.             IN      A

;; ANSWER SECTION:

www.somewhere.com.      10800   IN      A       69.13.146.22

;; AUTHORITY SECTION:

somewhere.com.          6319    IN      NS      remote2.easydns.com.

somewhere.com.          6319    IN      NS      ns1.easydns.com.

somewhere.com.          6319    IN      NS      ns2.easydns.com.

somewhere.com.          6319    IN      NS      remote1.easydns.com.

;; ADDITIONAL SECTION:

remote2.easydns.com.    37015   IN      A       205.210.42.20

ns1.easydns.com.        73243   IN      A       216.220.40.243

ns2.easydns.com.        41552   IN      A       209.200.151.4

remote1.easydns.com.    122960  IN      A       209.200.131.4

Received 220 bytes from 192.168.1.1#53 in 280 ms

$
```

 where 192.168.1.1 is my local DNS server.  Substitute the DNS server listed in resolv.conf etc.

Can you post the /etc/resolv.conf file after DHCP negotiation, the address details of the internal interface of the DSL router, and some sample output for a DNS query?

----------

## sdia

Following are the network details from my XP box and it works fine

Ethernet adapter Local Area Connection:

        Connection-specific DNS Suffix  . : lan

        Description . . . . . . . . . . . : Realtek RTL8139 C+ Fast Ethernet NIC

        Physical Address. . . . . . . . . : 00-01-3F-68-A1-51

        Dhcp Enabled. . . . . . . . . . . : Yes

        Autoconfiguration Enabled . . . . : Yes

        IP Address. . . . . . . . . . . . : 194.144.215.154

        Subnet Mask . . . . . . . . . . . : 255.255.255.0

        Default Gateway . . . . . . . . . : 213.176.138.83

        DHCP Server . . . . . . . . . . . : 10.0.0.138

        DNS Servers . . . . . . . . . . . : 10.0.0.138

        Lease Obtained. . . . . . . . . . : Friday, October 21, 2005 5:54:18 PM

        Lease Expires . . . . . . . . . . : Friday, October 21, 2005 6:04:18 PM

As it shows DNS is 10.0.0.138 and yes this is the IP of my routers internal interface and the gw 213.176.138.83 I guess is IP for some machine that belong to my service provider. 

When I try the same with gentoo and after DHCP negotiation following is my 

/etc/resolv.conf

nameserver 10.0.0.138

search lan

but somehow it wont let me ping with FQDN ... as you pointed out my router is providing my Gentoo with wrong DNS info and that is causing problems... I have even tried to point nameserver entry in /etc/resolv.conf towards my gateway 213.176.138.83 but that too does not work... but the most annoying thing is "How come XP is provided with same info by my router and it manages to use the network?"

Finally, I am not able to post some sample DNS query from my gentoo as i dont have any of the net tools installed on my gentoo... tried to look for nslookup/host/dig but none is there... tommorow will carry my machine to my work place and get these tools emerged... thanks guys...

----------

## saturas

 *sdia wrote:*   

> 
> 
>         IP Address. . . . . . . . . . . . : 194.144.215.154
> 
>         Subnet Mask . . . . . . . . . . . : 255.255.255.0
> ...

 

your settings are very strange. first of all the default GW has to be in the same network with your ip.

so, in my opinion it is a wonder of networking that your network effectively works.

----------

## sdia

True, but its not be... its my service provider... I setup my router with the CD and the user setting they provided ... and thats what it is... as stated earlier these are the setting my XP/Gentoo get from router using dhcp... strange but thats what it is...  

No one is commenting about Windows... how come XP is able to get around this strange configuration... need to find out? I got get my linux going as well....

----------

## Chris W

As saturas says, your default route should probably be pointing at the DSL router.   Does the Gentoo box get the same broken default route through DHCP?  It would help if you could post: 

```
# ifconfig eth0

# route

# ping -c 3 www.google.com
```

The last item will show if DNS resolution is working (without having bind-utils installed).  If the first line reads like:

```
PING www.l.google.com (66.102.7.147) 56(84) bytes of data.
```

 but there are no responses then it is routing that is crippling you.  Perhaps Windows is getting two default routes and using the other one (and not reporting it in your output). 

Wait on... is Windows running some PPPOE software (perhaps from the ISP CD)?  That might explain the odd addressing because the windows-ISP link is Point-to-point and the end-point addresses are independent.  If the router is in bridge mode then you'll need Roaring Penguin on Linux to connect.  (The router will probably still offer DHCP locally to allow connections to it for administration.)

----------

## sdia

Lets have some good news first... I am right now using my gentoo from my home  :Smile:   as I am about to upload this post... this is such a wonderful feeling... but I guess this is just a hack and I need to get it sorted clean and nice... 

As Chris instructed... I got the required network tools emerged and tried host once my gentoo got the network setting from my router using DHCP ... and this is what it got

sdiaGentooLT ~ # ifconfig eth0

eth0      Link encap:Ethernet  HWaddr 00:02:3F:68:A1:51

          inet addr:194.144.215.154  Bcast:194.144.215.255  Mask:255.255.255.0

          UP BROADCAST NOTRAILERS RUNNING MULTICAST  MTU:1500  Metric:1

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

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

          collisions:0 txqueuelen:1000

          RX bytes:751469 (733.8 Kb)  TX bytes:153016 (149.4 Kb)

          Interrupt:10 Base address:0x6000

sdiaGentooLT ~ # route

Kernel IP routing table

Destination     Gateway         Genmask         Flags Metric Ref    Use Iface

213.176.138.83  *               255.255.255.255 UH    0      0        0 eth0

194.144.215.0   *               255.255.255.0   U     0      0        0 eth0

loopback        localhost       255.0.0.0       UG    0      0        0 lo

default         213.176.138.83  0.0.0.0         UG    0      0        0 eth0

sdiaGentooLT ~ # host -v www.somewhere.com 10.0.0.138

Trying "www.somewhere.com"

;; reply from unexpected source: 193.4.194.2#53, expected 10.0.0.138#53

;; reply from unexpected source: 213.176.128.51#53, expected 10.0.0.138#53

;; connection timed out; no servers could be reached

sdiaGentooLT~  

This failed but it points to some unknown IP 213.176.128.51 and that's what I added to my /etc/resolv.conf and I got my network working... 

But I think this is a very ugly fix... Guys any idea what is going on here... following are the latest results from my so so working network 

sdiaGentooLT ~ # cat /etc/resolv.conf

nameserver 10.0.0.138

nameserver 213.176.128.51

search lan

sdiaGentooLT ~ #

sdiaGentooLT ~ # host -v www.somewhere.com 213.176.128.51

Trying "www.somewhere.com"

Using domain server:

Name: 213.176.128.51

Address: 213.176.128.51#53

Aliases:

;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 3330

;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 4, ADDITIONAL: 4

;; QUESTION SECTION:

;www.somewhere.com.             IN      A

;; ANSWER SECTION:

www.somewhere.com.      9575    IN      A       69.13.146.22

;; AUTHORITY SECTION:

somewhere.com.          9575    IN      NS      remote1.easydns.com.

somewhere.com.          9575    IN      NS      remote2.easydns.com.

somewhere.com.          9575    IN      NS      ns1.easydns.com.

somewhere.com.          9575    IN      NS      ns2.easydns.com.

;; ADDITIONAL SECTION:

ns1.easydns.com.        158341  IN      A       216.220.40.243

ns2.easydns.com.        74110   IN      A       209.200.151.4

remote1.easydns.com.    74110   IN      A       209.200.131.4

remote2.easydns.com.    80728   IN      A       205.210.42.20

Received 203 bytes from 213.176.128.51#53 in 23 ms

sdiaGentooLT ~ # route

Kernel IP routing table

Destination     Gateway         Genmask         Flags Metric Ref    Use Iface

fe0-0.xdsl03.is *               255.255.255.255 UH    0      0        0 eth0

194.144.215.0   *               255.255.255.0   U     0      0        0 eth0

loopback        localhost       255.0.0.0       UG    0      0        0 lo

default         fe0-0.xdsl03.is 0.0.0.0         UG    0      0        0 eth0

Guys I need so more help to get it done properly...but at least now I can browse using my gentoo  :Wink:  ... thanks

----------

## sdia

When I initially did my router setup with the service provider CD ... I had to choose 

PPPoA (DHCP Spoofing) in "service provided" options as service provided to me by my ISP... followed by user name and password details... and once the router was programmed and the router set-up wizard ends... it requires to reboot XP before being able to access the network...

As a result XP is surely running/using PPPoA software to get into the network... 

But this is somewhat confusing me... what the hell is router doing then... Being a ROUTER it shoud hide the details about whatever protocol it uses to communicate with ISP.... and provide pure ethernet connectivity between itself and my XP/Gentoo box right... 

Why am I requied to install PPPoA packages either on my XP or Gentoo?

Is the router useless / misleading or I was doing something stupid?

----------

## Cintra

I have recently updated from a non-router adsl speedtouch 510i to a router 510i..

in net.conf I have config_eth0=( "dhcp" )  as advised in another thread. 

following your thread I see my resolv.conf has been replaced by a link to /etc/ppp/resolv.conf which contains

```
# Generated by dhcpcd for interface eth0

domain lan

nameserver 10.0.0.138

```

this is the admin address of my router 510i, which I use to access the box in XP. I too used an ISP supplied CD to set the box up on XP.. I had great difficulty trying to get Gentoo on the air until I realised the new box was a router, then I simply changed my net.conf from config_eth0=( "adsl") to "dhcp" and emerged dhcpcd.. other than adding net.eth0 to boot run level that was it.

```
# route -v

Kernel IP routing table

Destination     Gateway         Genmask         Flags Metric Ref    Use Iface

10.0.0.0        *               255.255.255.0   U     0      0        0 eth0

loopback        *               255.0.0.0       U     0      0        0 lo

default         SpeedTouch.lan  0.0.0.0         UG    0      0        0 eth0

```

and

```
# host -v www.google.com 10.0.0.138

Trying "www.google.com"

Using domain server:

Name: 10.0.0.138

Address: 10.0.0.138#53

Aliases:

;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 25574

;; flags: qr rd ra; QUERY: 1, ANSWER: 4, AUTHORITY: 5, ADDITIONAL: 5

;; QUESTION SECTION:

;www.google.com.                        IN      A

;; ANSWER SECTION:

www.google.com.         790     IN      CNAME   www.l.google.com.

www.l.google.com.       23      IN      A       64.233.161.147

www.l.google.com.       23      IN      A       64.233.161.99

www.l.google.com.       23      IN      A       64.233.161.104

;; AUTHORITY SECTION:

l.google.com.           41351   IN      NS      e.l.google.com.

l.google.com.           41351   IN      NS      a.l.google.com.

l.google.com.           41351   IN      NS      b.l.google.com.

l.google.com.           41351   IN      NS      c.l.google.com.

l.google.com.           41351   IN      NS      d.l.google.com.

;; ADDITIONAL SECTION:

a.l.google.com.         50513   IN      A       216.239.53.9

b.l.google.com.         50513   IN      A       64.233.179.9

c.l.google.com.         50513   IN      A       64.233.161.9

d.l.google.com.         50513   IN      A       64.233.183.9

e.l.google.com.         50513   IN      A       66.102.11.9

Received 260 bytes from 10.0.0.138#53 in 23 ms

```

hope the comparison is of help

Mvh

Edit.. do you get the setup speedtouch admin menu by using any browser, and address 10.0.0.138 ?

----------

## Chris W

Gentoo is not resolvng addresses in your original situation because it (correctly) refuses to accept DNS replies from servers it did not query.  The broken query goes like this:  

```

Host               Router/Bridge      ISP

| -- DNS Query -> |                 |

|                 | -- DNS Query -> |

|                 |                 |

| <-- DNS reply ------------------- | DNS Server #1

| <-- DNS reply ------------------- | DNS Server #2

```

but Linux is expecting:

```

Host              Router/Bridge      ISP

| -- DNS Query -> |                  |

|                 | -- DNS Query ->  |

|                 |                  |

|                 | <-- DNS reply -- |

| <-- DNS reply - |                  |

```

What Cintra describes above is the typical DSL Router (NAT) setup.  The router acts as a DHCP server for the local LAN and allocates addresses from a private range (10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16 etc.).  All machines on the LAN get the router's internal address (10.0.0.138) as both default route and DNS server.  The router is responsible for connecting to the ISP, doing address translation for traffic from inside onto the 'net, and forwarding DNS queries.  This setup will work with any machine on the internal LAN (Win, Linux, Mac).  I imagine your Speedtouch can be configured this way.

If your ISP can do PPPOE then you could also configure the modem as a bridge and run Roaring Penguin on Linux, and an equivalent built-in functionality in Windows XP [1].  In this mode the router becomes invisible and the Windows/Linux machine is, for all intents, dirrectly linked to the 'net.

[1] http://www.carricksolutions.com/windowsxp.php#1

----------

## sdia

Thanx Chris and other guys... finally got my gentoo working... finally had to re-configure my router again using my ISP CD but this time I used DHCP-NAT configuration/service instead of DHCP_Spoofing....and it works fine now... and the routing table is clean as well....

```
 

# route -v

Kernel IP routing table

Destination     Gateway         Genmask         Flags Metric Ref    Use Iface

192.168.1.0        *               255.255.255.0   U     0      0        0 eth0

loopback        *               255.0.0.0       U     0      0        0 lo

default         192.168.1.254  0.0.0.0         UG    0      0        0 eth0 

```

Now I can start building my linux box...  :Wink: ... will start working on my wireless network card now... see ya

----------

## Cintra

Well done  :Smile: 

see you around..

----------

## Chris W

Glad to be of service.  You might consider changing the title to add "[Solved]"

----------

