I added the following line to my resolv.conf to allow for shorthand querying servers on my local domain.

search local.

If I have a server named myserver.local I can ping the server using "ping myserver", however if I try to "ping myserver.local" it stalls and fails to return an IP address. Pinging other hosts, such as google.com works as expected.

Is there a way that I can make both "ping myserver.local" and "ping myserver" work correctly?

  • Are you sure adding local into your resolv.conf is the right place? Zeroconf != DNS.
    – Zoredache
    Feb 2, 2012 at 22:29
  • I'm adding local as a shortcut so I don't need to type the full fqdn in each time, I can just type the first part. The search option has documentation in the resolv.conf man page.
    – Justin
    Feb 3, 2012 at 7:30
  • 1
    Yes, it is is a perfectly valid for DNS, but do you actually have a DNS ZONE for .local? Or are you using avahi/bonjour/zeroconf. Zeroconf is NOT DNS, so the configuration for the DNS resolver is probably not going to be very useful for you. If you actually have a DNS zone, and you have disabled any Zeroconf facilities in your systems, then ignore my comment.
    – Zoredache
    Feb 3, 2012 at 7:42
  • Yes, I have a bind server setup and serving out .local
    – Justin
    Feb 7, 2012 at 0:58

2 Answers 2


You need to remove the . after local:

search local

Assuming you have a dns resolver setup for your local domain, it should work as you're describing.

  • The . signifies the root level and should be valid syntax. Nevertheless I did try your suggestion and it didn't work. Thanks for the help though
    – Justin
    Feb 3, 2012 at 7:33

It seems that this was not an issue with resolv.conf, but nsswitch.conf. There seems to be some issues with DNS resolution and mdns4_minimal if the application is 64bit. There is a few documented bugs but just to link one: Ubuntu Launchpad Bug#140663.

Uninstalling the package libnss-mdns resolved my issue.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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