I am VPNed in to a network which has its own search domain, and it mostly works - I don't have to type the domain in the browser, and the host command resolves to the correct IPs.

However, when I try to ssh to a host on that network, ssh tells me it could not resolve the hostname.

This is very perplexing as I have never seen this issue before - the system is either resolving correctly or not at all.

Any thoughts or suggestions?


3 Answers 3


Have you tried to SSH to the IP address? It may be simple enough to work. Take the DNS out of the picture if you have the IP addresses of the hosts.

Whenever I use SSH out of Terminal I have always used the IP address and never had any issues.


For reference - this is exactly what I was looking for: http://www.eigenspace.org/2011/07/fixing-osx-lion-dns-search-domains/


Same thing here:

macbook:~ mark$ host 22r1
22r1.example.com has address
macbook:~ mark$ ping 22r1
ping: cannot resolve 22r1: Unknown host
macbook:~ mark$ 

...for now we've worked around it for SSH at least, by adding the following to userland ~/.ssh/config file:

Host *
     HostName %h.example.com   

  • Working in 2023. Commented Feb 24, 2023 at 4:18

You must log in to answer this question.

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