Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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.

share|improve this question

1 Answer 1

up vote 1 down vote accepted

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

share|improve this answer
    
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 '11 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. –  Steve Mayne Mar 15 '11 at 13:45

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.