How to set search domain for command line?

I've set a search domain in "System Preference" > "Network" > "Advanced" > "Search Domains". But, on the command line, it's not effective:


$ ssh myremotemachine

ssh: Could not resolve hostname myremotemachine: nodename nor servname provided, or not known


See? ssh doesn't even try to use the search domain.

MacBook Pro 13”, macOS 10.15

Posted on Nov 20, 2019 4:00 AM

Reply

Similar questions

3 replies

Nov 25, 2019 4:58 AM in response to chris_g1

Thanks, but I don't see how to set a search domain in the Directory Utility. It includes some settings about DDNS, but what do they have to do with the search domain? (As I understand it, DDNS allows you to register your machine name to the DNS service, but I don't know how to achieve my goal as stated above with DDNS.)


On classical Unix/Linux, you write the search domain in /etc/resolv.conf . There is no "dynamic" issues here.


This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

How to set search domain for command line?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.