Ask Different is a question and answer site for power users of Apple hardware and software. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Access to a local DNS server is always delayed by ~1 second.

I enabled the DNS server on OS-X Lion and it does indeed work. However when I query it using 'dig' (or nslookup) there is a delay of about 1 second before the reply is given. This delay is not reported by 'dig', which gives a response time of 0ms.

So for example a query using the OpenDNS servers completes sooner than one to the local server despite the name resolution taking 135ms longer:

$ time dig @

;; Query time: 135 msec

real 0m0.172s user 0m0.008s sys 0m0.006s

$ time dig @localhost

;; Query time: 0 msec

real 0m1.068s user 0m0.009s sys 0m0.007s

The delay does not seem to be in the named server, as when using named -g to view logs there is also a 1s delay before the request is printed.

FYI: my changes to enable DNS were:

rndc-confgen -b 256 > /etc/rndc.conf
head -n5 /etc/rndc.conf | tail -n4 > /etc/rndc.key
edit /etc/rndc.conf to correct port number
edit /etc/named.conf to add this to the options:

forward first;
forwarders {;;

run named from the shell (/usr/sbin/named -g)

share|improve this question

If you have localhost in /etc/hosts you also need to add a ::1 localhost line.

You may find that the delay has something to do with resolving the name 'localhost'. If you use instead, the delay should be reduced to milliseconds.

$ time dig @

;; Query time: 10 msec

real 0m0.029s user 0m0.007s sys 0m0.005s

I don't know where the resolution of 'localhost' occurs or why it takes such a long time, but I guess it doesn't really matter...

share|improve this answer

Your Answer


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.