0

I just deployed a server with a site that hosts some resources I want to fetch using scripts. If I browse to those resources in Chrome (even ones I have never been to before -- so I don't think it's a cache issue) they come up instantly, but when I fetch them using a script it takes about 5 seconds to connect.

I don't think this has anything to do with my site, I think it's a local configuration problem. I see the same results with google. Browsing to google it comes up instantly, but:

% curl google.com
***5 second delay***
<HTML><HEAD><meta http-equiv="content-type" content="text/html;charset=utf-8">
...

A yet-more perplexing thing given that last behavior is that if I ping my server or google, it shows the IP address instantly, so I think that kind of rules out a DNS issue, but I am not sure.

Any idea what is going on here?

I'm running Ubuntu Maverick, on a home Comcast network.

1 Answer 1

1

If you run Wireshark you should be able to inspect the packets that are being sent from your PC and their replies. This should help you to pinpoint the problem.

My hunch would be DNS resolution - but your ping test would suggest otherwise.

NB: Wireshark is in the official apt repository: sudo apt-get install wireshark

2
  • After some hacking, it appears to be my router's DNS relay. I replaced my router with another one that was lying around and all is well. Marked as accepted for the hell of it, thanks for inspiring me to look harder (didn't know if this was a thing that was common).
    – luqui
    Mar 15, 2011 at 13:35
  • @luqui - thanks. Yes, I've had problems with slow DNS resolution before. Funnily enough that was my router's caching DNS as well. Mar 15, 2011 at 13:45

You must log in to answer this question.

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