If you would like to be put a system's name in your web browser, e.g., ajax, into your browser's address bar and have the system automatically append a domain name, e.g. example.com, so that the browser attempts to access ajax.example.com, even though you just typed ajax, you can modify the Domain Name System (DNS) search domain settings. To do so on an Apple OS X/macOS system, take the following steps:
example.com
.
Now if you type a host name, such as ajax or acme, the system should
automatically add the example.com domain as a suffix to the domain name.
So, if you put http://acme
in a web browser's address bar, the
browser should attempt to access http://acme.example.com
or
if you type ping acme
in a
Terminal window, the system should ping
acme.example.com
.
You can add multiple domains; domains will be searched in the order you list them with the search starting at the topmost entry and continuing down through the list of domains with the search stopping when a valid name is found.
You can see which domains will be searched from a
command-line interface (CLI), e.g., a
Terminal window, using the
networksetup command networksetup -getsearchdomains
network_service
, where network_service is one of the
available types of network connections, e.g. Wi-Fi, Thunderbolt Ethernet, USB
Ethernet, etc., as shown below:
$ networksetup -getsearchdomains wi-fi example.com $