Super User is a question and answer site for computer enthusiasts and power users. 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

I have a centos linux running as a virtual machine in a Virtual Box on my Mac OS 10.8.2. The virtual machine has the IP address I created an entry in /etc/hosts with

When I try to ping the virtual machine via


it takes about 30 seconds for the first ping, after that, everything works as expected:

meckbuck2:~ mimi$ ping -n
PING ( 56 data bytes
64 bytes from icmp_seq=0 ttl=64 time=0.521 ms
64 bytes from icmp_seq=1 ttl=64 time=0.294 ms
64 bytes from icmp_seq=2 ttl=64 time=0.274 ms

If I use ping (no DNS resolution), everything is fast and the first ping starts within fractions of a second. So it seems as something is broken with the name resolution on my computer. Can anybody give me a hint how to solve this? It is a new MacBook Retina 15" which I set up from scratch less than a week ago.

I have also tried centos.localhost as a domain name - same problem here.

Once the domain is resolved and the IP is there, everything works as expected (ssh, smb, http...). Any hint is welcome!

Edit: I used dtruss to get a dump of the syscalls when I ping the server name. The ping gets stuck at the end of the trace. You can find it here:

Edit 2: I followed the instructions on to set up a local DNS server. Still the same issue.

tcpdump gives me the following output when I start a ping on the virtual machine:

01:16:27.668409 IP > 26754+ A? (46)
01:16:27.668456 IP > 41456+ AAAA? (46)
01:16:27.670650 IP > 26754 3/8/0 CNAME, CNAME, A (275)
01:16:27.670932 IP > 41456 2/1/0 CNAME, CNAME (176)
01:16:33.178960 IP > 21942+ A? (40)
01:16:33.180452 IP > 21942 1/8/0 A (200)
01:16:46.876547 IP > 6871+ A? (53)
01:16:46.877900 IP > 6871 8/10/5 A, A, A, A, A, A, A, A (494)
01:16:53.863153 IP > 32328+ A? (40)
01:16:53.884441 IP > 32328 1/8/0 A (200)

Edit 3: Here is my output of scutil --dns

meckbuck2:~ mimi$ scutil --dns
DNS configuration

resolver #1
  search domain[0] :
  search domain[1] :
  nameserver[0] :
  reach    : Reachable,Local Address

resolver #2
  domain   : local
  options  : mdns
  timeout  : 5
  order    : 300000

resolver #3
  domain   :
  options  : mdns
  timeout  : 5
  order    : 300200

resolver #4
  domain   :
  options  : mdns
  timeout  : 5
  order    : 300400

resolver #5
  domain   :
  options  : mdns
  timeout  : 5
  order    : 300600

resolver #6
  domain   :
  options  : mdns
  timeout  : 5
  order    : 300800

resolver #7
  domain   :
  options  : mdns
  timeout  : 5
  order    : 301000

DNS configuration (for scoped queries)

resolver #1
  search domain[0] :
  search domain[1] :
  nameserver[0] :
  if_index : 4 (en0)
  flags    : Scoped

reach : Reachable,Local Address

share|improve this question

migrated from Dec 29 '12 at 16:22

This question came from our site for system and network administrators.

The trace is interesting, but I suspect you might see more useful info if you try running tcpdump -n port 53. You'll probably need to add a -i interface name also. – Zoredache Dec 27 '12 at 18:22
This might be helpful. – Aaron Copley Dec 27 '12 at 19:04

Might be some program is trying to update. I would guess you have already looked at setting the the Domain Name Server to something like Google DNS. There is a freeware for Apple that is called NameBench, which might provide more data.

share|improve this answer

You must log in to answer this question.