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´m trying to configure search domains on OSX, however with no succes.

I configured my search domain for the Wi-FI interface on network preferences, like this:

OSX preferences

However when trying to resolve any host, either from web browser or terminal, it does not append the domain:

DNS resolving error

share|improve this question
I added to search domains, accepted, applied the configuration and worked as expected when I pinged mail: it actually resolved Have you pressed the button 'Apply' in network configuration after making the changes? Does it work if you try ping srvcon17.consultec.local? – jaume Feb 14 '13 at 9:37
Did you try with a .local domain? Yes it does work when I try to ping with the fullname. – Iñaki Elcoro Feb 14 '13 at 13:24
No, I haven't, I don't have any .local domain to test with. I don't see why it shouldn't work with a .local domain, though, provided the DNS server is properly configured. To check it, could you add the output of nslookup -query=ns consultec.local to your question? – jaume Feb 14 '13 at 13:48
up vote 3 down vote accepted

I solved using a script to add the domain suffix via scutil, open a terminal and run:

get State:/Network/Service/yourvpnconnection/DNS
d.add DomainName mydomain.local
set State:/Network/Service/yourvpnconnection/DNS

It seems that the DNS suffix configuration does not apply to dynamically created VPN connections, like the forticlient SSL VPN client creates. So this script configures the search domain options for the dynamically created connection.

share|improve this answer

The .local "TLD" is reserved for use with mDNS ("Bonjour" in Apple-land), I can only assume this is the cause for these problems. (Names ending in .local can be expected to be resolved in mDNS rather than DNS.)

Also see and

share|improve this answer
.local worked fine for me all the time, no mDNS here. – slhck Jul 28 '13 at 11:02
I solved using scutil see my answer – Iñaki Elcoro Aug 1 '13 at 6:47

You can just create a directory in /etc called resolver and then create a file with the settings of your domain in it.

For example, if your domain is "lan":

mkdir /etc/resolver
vi /etc/resolver/lan

Add the following to the "/etc/resolver/lan" file:

 domain lan
 search lan
 nameserver your_nameserver_ip

You will now be able to ping client1.lan client2.lan etc. over VPN.

This will make sure that it will first search through the custom settings and when it doesn't match your query it will then use the default dns domain and search settings.

share|improve this answer

You must log in to answer this question.

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