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

Ive been playing aroudn with the twitter API in a webserver and in my local machine. Ive noticed that in my local machine it works MUCH slowlier, so I think I have some DNS problems. Doint this commands gave me:

time echo "" | nc google.com 80

time: 20 seconds

time echo "" | nc 173.194.65.103 80

time: Instantly

Im running Ubuntu 11.10. Do you guys know how could I solve this? Thanks

share|improve this question
    
Pedantic comment: DNS is not the same as resolving. They are two different functions. You had a resolver problem, not a DNS problem. –  anastrophe Dec 10 '11 at 17:53
    
Why is this question downvoted? –  Dbugger Mar 20 at 20:27
    
Note me that downvoted it but your analysis of the problem is incomplete. –  symcbean Mar 20 at 23:41
    
What do you mean with "incomplete"? What do you thing is missing? –  Dbugger Mar 20 at 23:59
add comment

2 Answers

Try using dig to debug the DNS output. It will give you the response time of your nameserver:

$ dig google.com

; <<>> DiG 9.6-ESV-R4-P3 <<>> google.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 7643
;; flags: qr rd ra; QUERY: 1, ANSWER: 6, AUTHORITY: 0, ADDITIONAL: 0

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

;; ANSWER SECTION:
google.com.     211 IN  A   209.85.147.147
google.com.     211 IN  A   209.85.147.99
google.com.     211 IN  A   209.85.147.103
google.com.     211 IN  A   209.85.147.104
google.com.     211 IN  A   209.85.147.105
google.com.     211 IN  A   209.85.147.106

;; Query time: 14 msec
;; SERVER: x.x.x.x#53(x.x.x.x)
;; WHEN: Sat Dec 10 17:01:05 2011
;; MSG SIZE  rcvd: 124
share|improve this answer
add comment
up vote 0 down vote accepted

I solved it by changing in /etc/resolv.conf

this lines:

nameserver 208.67.222.222
nameserver 208.67.220.220

This is openDNS. Apparently my router DNS sucks. Thanks!

share|improve this answer
2  
You can use code.google.com/p/namebench to check out which are the fastest DNS servers for your location. –  LinuxDevOps Mar 20 at 20:23
1  
I never use my home router's DNS for this reason - I usually set them as Google's Anycast DNS (8.8.8.8 or 8.8.4.4) or Level3's Anycast DNS (4.2.2.2 or 4.2.2.1 to 6). –  Mat Carlson Mar 20 at 20:43
    
It's HIGHLY unlikely that your router is doing anything other than using the DNS providers supplied to it by DHCP - i.e. it's more likely the fault of your service provider. Either that or you've misconfigured the router. –  symcbean Mar 20 at 23:40
add comment

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.