4

I have a PC connected to the Internet using an Ethernet connection. Using Ubuntu I am able to resolve domains using nslookup, but if I try to run "ping google.com" or "ping 74.125.39.104" it doesn't work.

I have used Arch Linux, Mint and Ubuntu Live on two netbooks, all of them unsuccessfully. Windows, however, works just fine. Save me from using Windows!

ifconfig:

sudo ifconfig eth0
eth0      Link encap:Ethernet  HWaddr 00:26:18:80:79:18  
          inet addr:10.20.6.180  Bcast:10.20.7.255  Mask:255.255.254.0
          inet6 addr: fe80::226:18ff:fe80:7918/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:5751 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2397 errors:0 dropped:0 overruns:0 carrier:17
          collisions:0 txqueuelen:1000 
          RX bytes:659976 (659.9 KB)  TX bytes:253881 (253.8 KB)
          Interrupt:40

route:

route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
10.20.6.0       0.0.0.0         255.255.254.0   U     1      0        0 eth0
169.254.0.0     0.0.0.0         255.255.0.0     U     1000   0        0 eth0
0.0.0.0         10.20.6.1       0.0.0.0         UG    0      0        0 eth0
0.0.0.0         10.20.6.1       0.0.0.0         UG    202    0        0 eth0

netstat:

netstat -nr
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
10.20.6.0       0.0.0.0         255.255.254.0   U         0 0          0 eth0
169.254.0.0     0.0.0.0         255.255.0.0     U         0 0          0 eth0
0.0.0.0         10.20.6.1       0.0.0.0         UG        0 0          0 eth0
0.0.0.0         10.20.6.1       0.0.0.0         UG        0 0          0 eth0

iptables:

sudo iptables -L
Chain INPUT (policy ACCEPT)
target     prot opt source               destination         

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination         

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination

resolv.conf:

cat /etc/resolv.conf
# Generated by resolvconf 
search uni-mannheim.de 
nameserver 134.155.96.51 
nameserver 134.155.96.53

tracepath is not working:

sudo tracepath www.google.com
 1:  laptop.local                                          0.342ms pmtu 1500
 1:  no reply
 2:  no reply
 3:  no reply
 4:  no reply

/etc/host.conf

sudo cat /etc/host.conf
# The "order" line is only used by old versions of the C library.
order hosts,bind
multi on

/etc/nsswitch.conf

sudo cat /etc/nsswitch.conf
# /etc/nsswitch.conf
#
# Example configuration of GNU Name Service Switch functionality.
# If you have the `glibc-doc-reference' and `info' packages installed, try:
# `info libc "Name Service Switch"' for information about this file.

passwd:         compat
group:          compat
shadow:         compat

hosts:          files mdns4_minimal [NOTFOUND=return] dns mdns4
networks:       files

protocols:      db files
services:       db files
ethers:         db files
rpc:            db files

netgroup:       nis

nslookup google.com

nslookup google.com
Server:     134.155.96.51
Address:    134.155.96.51#53

Non-authoritative answer:
Name:   google.com
Address: 74.125.39.104
Name:   google.com
Address: 74.125.39.105
Name:   google.com
Address: 74.125.39.106
Name:   google.com
Address: 74.125.39.147
Name:   google.com
Address: 74.125.39.99
Name:   google.com
Address: 74.125.39.103

wget google.com

wget google.com
--2011-08-17 11:05:01--  http://google.com/
Resolving google.com... 74.125.39.99, 74.125.39.103, 74.125.39.104, ...
Connecting to google.com|74.125.39.99|:80...

dig google.com

tracepath doesn't work but dig does

dig google.com

; <<>> DiG 9.7.3 <<>> google.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 2643
;; flags: qr rd ra; QUERY: 1, ANSWER: 6, AUTHORITY: 4, ADDITIONAL: 4

;; QUESTION SECTION:
;google.com.            IN  A

;; ANSWER SECTION:
google.com.     175 IN  A   74.125.39.103
google.com.     175 IN  A   74.125.39.104
google.com.     175 IN  A   74.125.39.105
google.com.     175 IN  A   74.125.39.106
google.com.     175 IN  A   74.125.39.147
google.com.     175 IN  A   74.125.39.99

;; AUTHORITY SECTION:
google.com.     104161  IN  NS  ns4.google.com.
google.com.     104161  IN  NS  ns3.google.com.
google.com.     104161  IN  NS  ns1.google.com.
google.com.     104161  IN  NS  ns2.google.com.

;; ADDITIONAL SECTION:
ns1.google.com.     277325  IN  A   216.239.32.10
ns2.google.com.     277325  IN  A   216.239.34.10
ns3.google.com.     277325  IN  A   216.239.36.10
ns4.google.com.     277325  IN  A   216.239.38.10

;; Query time: 2 msec
;; SERVER: 134.155.96.51#53(134.155.96.51)
;; WHEN: Wed Aug 17 11:06:14 2011
;; MSG SIZE  rcvd: 260
1
  • I'm sure you don't actually connect to the Internet by ethernet (unless you are in a co-location facility). So what is it that you are connect to?
    – Keith
    Aug 17, 2011 at 8:47

3 Answers 3

1

Don't worry too much about ping, it isn't unusual for ping to be blocked by server infrastructure. Ping and traceroute typically use ICMP. A better test is to use wget http://www.google.com which uses HTTP.

First use host www.google.com to test DNS (older Linux systems would have nslookup or dig instead of host)

$ host www.google.com
www.google.com is an alias for www.l.google.com.
www.l.google.com has address 209.85.143.104
www.l.google.com has address 209.85.143.99


$ wget http://www.google.com
--12:21:13--  http://www.google.com/
           => `index.html'
Resolving www.google.com... done.
Connecting to www.google.com[209.85.143.99]:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]

    [                                  ] 9,931        167.21K/s

12:21:14 (167.21 KB/s) - `index.html' saved [9931]
4
  • executing the command "host google.com" gives the correct output (the list of ip and mail ip) Running "wget google.com" gives the following output: --2011-08-16 22:41:28-- google.com Resolving www.google.com... failed: Name or service not known. wget: unable to resolve host address 'www.google.com' What can the reason be? I guess it's related to the problem with tracepath, what do you think?
    – Francesco
    Aug 16, 2011 at 20:45
  • I think its bizarre. What do you have in /etc/host.conf and /etc/nsswitch.conf? Aug 16, 2011 at 21:13
  • I added the outputs to the post. Thank you for your time! this problem is getting me crazy, sigh...and it happens on live distros too, so it's not some misconfiguration on my machine. What makes me angry is that windows works fine just plugging in the cable...thank you
    – Francesco
    Aug 17, 2011 at 8:40
  • also I noticed that tracepath doesn't work, but dig does...
    – Francesco
    Aug 17, 2011 at 9:13
0

What is your /etc/resolve.conf? It should point to your router

This file is very important to connect to the internet.

1
  • resolv.conf # Generated by resolvconf search uni-mannheim.de nameserver 134.155.96.51 nameserver 134.155.96.53 Isn't this file related to dns resolve? because that's the only thing working right now. Thanks for your time!
    – Francesco
    Aug 16, 2011 at 9:35
0

Verify for the Firestarter firewall:

chkconfig -l | grep firestarter

firestarter 0:off 1:off 2:off 3:off 4:off 5:off 6:off S:on

Disable the Firestarter firewall:

sudo chkconfig firestarter off

And check again:

chkconfig -l | grep firestarter

firestarter 0:off 1:off 2:off 3:off 4:off 5:off 6:off

And stop the firewall:

sudo firestarter -p

Go on, try to ping again.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .