United States (change)
Shortcuts: Downloads Fedora Red Hat Network
Account Links: Cart Your Account Logout
Suppose we have a domain example.com and within that domain we have a two subdomains; sales.example.com and eng.example.com. Now, suppose we have 2 hosts named:
server.sales.example.com server.eng.example.com
The resolv.conf file on our client system has a search path like:
search sales.example.com example.com
The following lookup works without an issue:
$ host server.eng.example.com
and this lookup returns the address for server.sales.example.com
$ host server
But this lookup fails:
$ host server.eng
The reason for this is that, by default, the resolver presumes that any hostname with a dot in the name is a fully qualified domain name (FQDN) and will not attempt to append domains listed in the search path to these names.
This is configurable, however, by setting the ndots option in the /etc/resolv.conf file. For instance, adding the following line should make the last lookup work:
options ndots:2
This tells the resolver not to try appending any search path domains to hostnames with two or more dots in the name (the default for ndots is 1). After making this change, a lookup of server.eng should work.