I use network setup to modify my search domains which works fine so far, but it only does it per device. Once I VPN somewhere, it no longer uses those changes. Is there a way to set the search domains globally (ie. for every device: Ethernet, Wi-Fi, and VPN) on Mac OS X Lion?

migrated from serverfault.com Oct 16 '12 at 14:10

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

  • Can you add your resolv.conf into the question? – DogEatDog Oct 17 '12 at 4:26

enter image description hereThere was a similar issue in 2002 with OS X. I found a few articles about it and I've been able to address this issue by simply adding "local" to the Search Domains in the advanced network properties of my network interface. This has allowed those of connecting via VPN to resolve .local hosts.


Why not just add it to the adapter in question? i.e. ethernet or Wi-Fi: http://support.apple.com/kb/PH14159

com.apple.mDNSResponder.plist can be overwritten by something else/update and you will forget it. The url above is the "supported" way to add the domain search path to the DNS query.


If you want a strict command line solution, you can add the search domains manually to each adapter/service.

  1. List all networkservices to get the common names:

    $ networksetup -listallnetworkservices
    Thunderbolt Bridge
    Thunderbolt Ethernet
  2. Check the current searchdomain setting on the device you want to update (You must fully quote devices with spaces in the names):

    $ networksetup -getsearchdomains "Thunderbolt Ethernet"
  3. Then add the searchdomains you want where they are missing:

    $ networksetup -setsearchdomains "Wi-Fi" yourdomain.com yourdomain.lan

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .