# Linux – In /etc/resolv.conf, what exactly does the “search” configuration option do

dnslinux

If I have the option set as the domain name of the server itself, does that mean the server itself is used first to lookup domain names before querying the external internet? i.e. /etc/hosts will be queried?

For example:

search  localdomain.com


To summarize the above, assuming no change from the defaults mentioned above, if something gets to the resolver that has no dots in it, the resolver will try adding localdomain.com to it.
So lets say you just type http://somesite/somedocument.html in your browser. The resolver will catch that and first try to resolve somesite.localdomain.com - equivalent if you actually typed http://somesite.localdomain.com/somedocument.html - before trying what you actually requested.