Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I'm investigating slow DNS responses on Ubuntu, I have installed bind9 to improve times from local cache, but still something is odd. What could make dig wait for 10 seconds and say that query time took 0?

time dig google.ro +all

; <<>> DiG 9.9.3-rpz2+rl.13214.22-P2-Ubuntu-1:9.9.3.dfsg.P2-4ubuntu1.1 <<>> google.ro +all
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: SERVFAIL, id: 9665
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;google.ro.                     IN      A

;; Query time: 0 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Mon Feb 17 20:15:19 CET 2014
;; MSG SIZE  rcvd: 38

dig google.ro +all  0.01s user 0.00s system 0% cpu 10.012 total
share|improve this question
4  
The status is SERVFAIL, it looks like something is wrong with your DNS server (it doesn't return anything), and 10 seconds is just dig's timeout. –  Chris Down Feb 17 at 19:29
    
@ChrisDown thanks for pointing this out. I would accept this as an answer. 0 msec is misleading. –  Rumca Feb 17 at 20:04
    
Ubuntu has been shipping dnsmasq and uses it by default, which already gives you a caching name server. I don't think there is anything to be gained by adding another one. –  Bananguin Feb 17 at 20:37
    
@Rumca Sure thing, I added it as an answer. –  Chris Down Feb 18 at 2:44
add comment

1 Answer 1

up vote 1 down vote accepted

The status is SERVFAIL, it looks like something is wrong with your DNS server (it doesn't return anything), and 10 seconds is just dig's timeout.

share|improve this answer
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.