This guide explains how to use your resolv.conf file to speed up logging into systems that share the same domain name.
/etc/resolv.conf file configures how the Linux system resolves hostnames. It contains the resolvers that the system will query in order to convert hostnames to IP addresses and vice versa.
In addition to listing resolving servers the
resolv.conf file can also take the
search option that will save you a great deal of typing in the right situation.
search option takes a list of space-separated hostnames. Here is an example of the search option being used for two domain names:
search example.com example.org
These hostnames will be appended to any hostname which does not itself resolve and the new hostname checked to see if it resolves.
This is incredibly useful because many organizations tend to give their servers subdomains a small number of domain names e.g.:
web1.example.com web2.example.com filestore.example.com db.example.com
In this situation, putting this line into
Means you no longer have to use:
to SSH into
web1.example.com but instead can simply type:
example.com will be automatically appended to
web1. This will work for any command that uses hostnames on the command line and save you a lot of typing.