4

My machine is taking 10 seconds to establish a connection. Once the connection is established, it is up to speed and works correctly. But if I for example ping www.google.com, it takes 5 seconds for

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

to show up, and 5 more seconds for each

64 bytes from ag-in-f147.google.com (72.14.247.147): icmp_seq=1 ttl=243 time=100 ms

to show up.

My only clue is that I recently disconnected my computer from the Ethernet cable and rebooted it.

I use a static IP address and my router is configured correctly. My computer is the only one connected to the router that has this problem.

What configuration can I check to solve this problem?

andrewrk
  • 243
  • 1
  • 3
  • 9

2 Answers2

15

DNS.

Make sure that your reverse DNS is working properly. You can verify this by typing "ping -n www.google.com". Immediate responses.

Matt Simmons
  • 20,396
  • 10
  • 68
  • 116
  • Is this something I need to fix on my router or on my desktop? – andrewrk Jul 17 '09 at 03:13
  • +1 sounds like dns is the most likely issue here. – theotherreceive Jul 17 '09 at 03:15
  • 2
    superjoe: What are you using as your DNS server, because that's what is having the problem. You type "ping www.google.com" and your computer looks up www.google.com in DNS, and resolves it to the IP. Then, when it pings that IP, it does reverse resolution on that IP to get a hostname. That's the part that's failing, so your DNS server is having issues looking up reverse records. Since the resolution happens eventually (it gets ag-in-f147.google.com), your primary DNS may be faulty, and it may be reverting to your secondary. If they're static, try switching them. – Matt Simmons Jul 17 '09 at 03:23
  • One concern is that he said something about each ping taking 5 seconds, which isn't really born out in the ping line he pasted, but I'd be surprised if ping did a DNS lookup for every packet. If superjoe could clarify that. – David Pashley Jul 17 '09 at 06:38
  • David: I've seen this probably hundreds of times in around 12 years. You can mimic the error by "breaking" your resolv.conf. – Matt Simmons Jul 17 '09 at 11:25
  • @David: Yes, ping does a reverse DNS lookup for every packet it receives, as watching a tcpdump or strace of a ping session will happily demonstrate. – womble Jul 17 '09 at 23:27
0

Yes, a DNS problem. The solution was to edit /etc/resolv.conf.

The primary server was 192.168.0.1 when it should have been 192.168.1.1. Fixed that and the problem went away immediately.

The problem was caused by upgrading with aptitude full-upgrade, which overwrote the configuration file. Should probably report this to Debian Squeeze developers.

andrewrk
  • 243
  • 1
  • 3
  • 9