# DNS resolution - no internet

## Qweasda

Hi, I installed the 2.6-test2 kernel (my first 2.5/6 dev kernel) and the (natsemi) NIC worked, I coukd ping 127.0.0.1, it showed in ifconfig -a, but no internet works.

So I went back to 2.4, and a coupld days later recompiled the 2.4 kernel using the same config, only added 2 USB options is all. Now I have the same internet problem in that. I recompiled without those options, no luck. I have been Gentoo-less for over a week now, desperate.

----------

## taskara

so the 2.4 kernel WAS working, then u changed something (USB stuff) and now internet doesn't work, is that right?

what does ifconfig -a reveal in the new kernel?

----------

## ewildgoose

I think I have a very similar problem, see:

https://forums.gentoo.org/viewtopic.php?t=73685

However, so far I haven't had a nibble...

Try this for a debug step, use dig to query your ISP's dns server, observe it fail, then try forcing it to use TCP to query it (ie add +tcp to the command line)

For me the tcp version works, but udp is foobar'd

----------

## Qweasda

ifconfig -a in 2.6 shows me this:

```
Link encap :Ethernet HWaddr blahblahblah

BROADCAST MULTICAST MTU:1500 Metric:1

(skipped what I thought wasn't usefull)

RX bytes:0 90.0b) TX bytes:2360(2.3kb)

Interrrupt:5 Base address:0x6000

```

I had to write that down then type it here, so I left out a couple middle lines, if you need them I'll do it all.

ewildgoose: hmm, doing dig on my ISP's DNS returns as time out, host not found (or similar) and dig +tcp was a lot closer,  it showed the IP and couldn't resolve it. So maybe our problems are a bit different?

----------

## handsomepete

Your card isn't up or running - that might be part of the problem.  Should look something like this:

```
eth0      Link encap:Ethernet  HWaddr 00:02:B3:8C:5C:FE

          inet addr:172.18.2.18  Bcast:172.18.255.255  Mask:255.255.0.0

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

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

          TX packets:72820 errors:0 dropped:0 overruns:0 carrier:2

          collisions:37297 txqueuelen:100

          RX bytes:711770176 (678.7 Mb)  TX bytes:7081751 (6.7 Mb)

          Interrupt:11 Base address:0x5000
```

Does /etc/init.d/net.eth0 run successfully on boot?  If not, try bringing up your ethernet card the old fashioned way:

```
# ifconfig $IFACE $IPNUM broadcast $BCAST netmask $NMASK

# route add -net default gw $GTWAY netmask 0.0.0.0 metric 1 $IFACE
```

For example:

ifconfig eth0 192.168.0.10 broadcast 192.168.1.255 netmask 255.255.255.0

route add -net default gw 192.168.0.1 netmask 0.0.0.0 metric 1 eth0

Did you copy your 2.6 .config to 2.4 and make oldconfig?  If so, try make mrproper (it'll blow out your .config) and remake the kernel from scratch.  hth

----------

## Qweasda

Okay, here's a better, more detailed listing...

```

bash-2.05b# ifconfig -a

eth0      Link encap:Ethernet  HWaddr 00:A0:CC:7A:1C:02  

          BROADCAST MULTICAST  MTU:1500  Metric:1

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

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

          collisions:0 txqueuelen:100 

          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

          Interrupt:5 Base address:0x5000 

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:0 errors:0 dropped:0 overruns:0 frame:0

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

          collisions:0 txqueuelen:0 

          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

```

ifconfig (without -a) only shows lo, not eth0.

```

bash-2.05b# dig charter.net

; <<>> DiG 9.2.2 <<>> charter.net

;; global options:  printcmd

;; connection timed out; no servers could be reached

```

```

bash-2.05b# dig +tcp charter.net

;; Connection to 24.240.246.10#53(24.240.246.10) for charter.net failed: 

network unreachable.

;; Connection to 24.240.246.11#53(24.240.246.11) for charter.net failed: 

network unreachable.

```

/etc/init.d/net.eth0 runs fine on boot... "Bringing up eth0...OK"

```

bash-2.05b# ifconfig eth0 192.168.1.100 broadcast 192.168.1.255 netmask 

255.255.255.0 

```

```

bash-2.05b# route add -net default gw 192.168.0.1 netmask 0.0.0.0 metric 

1 eth0  

SIOCADDRT: Network is unreachable

```

Here are some pings, I can ping myself fine:

```

bash-2.05b# ping -c3 127.0.0.1

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

64 bytes from 127.0.0.1: icmp_seq=1 ttl=64 time=0.120 ms

64 bytes from 127.0.0.1: icmp_seq=2 ttl=64 time=0.052 ms

64 bytes from 127.0.0.1: icmp_seq=3 ttl=64 time=0.031 ms

--- 127.0.0.1 ping statistics ---

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

rtt min/avg/max/mdev = 0.031/0.067/0.120/0.039 ms

```

```

bash-2.05b# ping -c3 192.168.1.100

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

64 bytes from 192.168.1.100: icmp_seq=1 ttl=64 time=0.100 ms

64 bytes from 192.168.1.100: icmp_seq=2 ttl=64 time=0.055 ms

64 bytes from 192.168.1.100: icmp_seq=3 ttl=64 time=0.036 ms

--- 192.168.1.100 ping statistics ---

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

rtt min/avg/max/mdev = 0.036/0.063/0.100/0.028 ms

bash-2.05b# 

```

----------

## handsomepete

Is that the correct gateway IP?  If it is, maybe change your IP to 192.168.0.100 instead of 192.168.1.100.  It's good to have those first 3 sets of numbers match up.

----------

## Qweasda

Oops, that was the wrong gateway, mine's 192.168.1.1. I tried that but got the same results.

Changing .0.100 to .1.100 didn't do anything else either. It's always been .0, though.

I have tried to recompile my kernel from scratch, brand new .config and all, no luck. 2.6 must have done something to it. When I cooied 2.6 (bzImage-26) to my boot partition, I also copied system.map.

I have no idea what that does but the docs said to..that couldn't have had an affect could it?

----------

## taskara

according to this  *Quote:*   

> bash-2.05b# ifconfig -a 
> 
> eth0      Link encap:Ethernet  HWaddr 00:A0:CC:7A:1C:02  
> 
>           BROADCAST MULTICAST  MTU:1500  Metric:1 
> ...

 your card is detected but u don't have an ip assigned

u using dhcp?

or specifying an ip?

----------

## Qweasda

dhcp

----------

## taskara

well you aren't getting an IP then from your DHCP server..

can u try specifying an IP?

what sort of network are you on?

net.eth0 is still in the default run level isn't it?

and your /etc/conf.d/net is set to "use dhcp" ?

I'm assuming so, because all u have changed is your kernel, but still pays to be sure  :Wink: 

----------

## Qweasda

The only way I've ever gotten specify IP to work is if I plug the modem right into my box bypassing the router. I can try this tomorrow maybe, when everyone isn't using the internet.

My network is just a Linksys router.

net.eth0 is in the default run level, just checked to make sure, and it also always shows the "Bringing up eth0...OK"

Yep, /etc/conf.d/net is set to dhcp.

Could the new kernel somehow killed some network app or overwrote something? Sounds stupid, but I'm getting desperate....

I just recompiled 2.4.20 (after make clean and mrproper) with absolutely nothing changed from default settings minus what the install docs say (filesystems, and IDE stuff), my network card, and Reiserfs support. I even downloaded a fresh copy if ther kernel. Still a no go.

----------

## taskara

ok - well maybe the router is not handing out ip addresses properly?

why don't you try specifying an ip address?

what is the address of your router?

192.168.0.1 ?

if so, under your /etc/conf.d/net specify an ip address like 192.168.0.10 or something

gateway is your router (ie 192.168.0.1)

and make sure /etc/nameserver is set to your router too  :Smile: 

then restart your network and see if "ifconfig -a" reveals eth0 with an ip address

good luck!  :Smile: 

----------

## 0ctane

I am having similar troubles (and am writing this from my wife's Windoze box).  I was updating mplayer (which needed to emerge 37 packages and failed when trying to update xmms).  I got a message that a bunch of config files needed to be updated.  So I looked at them.  One of them was /etc/hosts and in it was ip6 stuff (fe00::0 ip6-localnet and others).  So I figured, what the hell, I'll give it a try.  After rebooting I cannot get out of my local network.  I can ping my D-link router fine, but any attempt to go to the outside word (cable modem) gives "network unreachable".  ifconfig shows my nic.  /etc/resolv.conf has the correct nameservers.

Any ideas?

----------

## taskara

can u post 

```
ifconfig -a
```

 ?

----------

## 0ctane

ifconfig -a results

```
eth0 Link encap:Ethernet HWaddr xx:xx:xx:xx:xx:xx

       inet addr:192.168.0.2 Bcast:192.168.0.255 Mask:255.255.255.0

       UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1

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

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

       collisions:0 txqueuelen:100

       RX bytes:7152 (6.9 Kb)  TX bytes:0 (0.0 b)

       Interrupt:11 Base address:0xec00

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:0 errors:0 dropped:0 overruns:0 frame:0

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

       collisions:0 txqueuelen:100

       RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

tunl0 Link encap:IPIP Tunnel  HWaddr

       NOARP MTU:1400 Metric:1

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

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

       collisions:0 txqueuelen:100

       RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)
```

(I am blocking my HWaddr.)

----------

## taskara

you're not running iptables or anything are you?

can u ping yourself?

can u ping your router?

can anyone ping you?

I notice you have received a few packets, but haven't transmitted any..

----------

## 0ctane

I can ping myself and the router.

----------

## 0ctane

Fixed my problem.  I looked at the x86 installation page for the idea.  I figured it had something to do with DNS name resolution, and I knew my /etc/resolv.conf was setup properly.  Anyhow, I ran the following command and everything now works.

```
dhcpcd eth0
```

----------

## taskara

can u ping an external ip address.. like 66.218.71.93 ?

----------

## taskara

cool  :Smile: 

that was where I was leading  :Wink: 

----------

## 0ctane

unfortunately, it does not seem to hold after a reboot.   I have to run the command again.  hmmm...

----------

## linux_weenie

try uncommenting

iface_eth0="dhcp" from your /etc/conf.d/net file. hope that helps you out.

-Will

----------

## taskara

 *linux_weenie wrote:*   

> try uncommenting
> 
> iface_eth0="dhcp" from your /etc/conf.d/net file. hope that helps you out.
> 
> -Will

 

but you will have to specify an ip then...

----------

## Qweasda

I'm getting aggrivated with this. Tomorrow, if not solved,  I'm going to reformat and reinstall my 15gb's of Gentoo goodness.  :Sad: 

I tried a specified IP, anyhoo. With it, ifconfig shows eth0, with the IP, so I don't need the -a option. Still no internet though.

dhcpcd eth0, btw doesn't work (set to dhcp in net or using static)

Once again with the static IP I can ping myself, and the router.

Any last ideas? almost 3 weeks w/o Gentoo is driving me insane. (useless without internet!)

----------

## taskara

can u ping an external ip address.. like 66.218.71.93 ?

what's your "gateway" setting in /etc/conf.d/net ?

----------

## Qweasda

No I can't ping an outside IP.

I have messwed with the default gateway option...commented, 192.168.1.1 (that is correct) and others just for hope, like 192.168.0.1, etc.

I did Gentoo wrong anyway, in the sense of make.conf, I left it default. I want to restart and get some nice flags going. Plus my partition is full, need to upsize that.

So, I'm not sab about reinstalling very much, will only take well worth time.  :Smile: 

Thanks for all your help Taskara, I appreciate it.

----------

## taskara

hehe.. yeah...

ok well have fun re-installing  :Very Happy:  I always do  :Wink: 

----------

