Reading Time: 3 minutes
Linux's default file that defines what DNS servers will be used /etc/resolv.conf typically contains directives with the default search domain or domains; used for FQDN (Fully Qualified Domain Name) completion when no domain suffix is supplied as part of the DNS query. Lets say sub-domains under domain.com has to be accessed (in /etc/resolv.conf) there is:
That is very handy whether you have to ssh or open in web browser (sites) or multiple servers each residing under a single main domain name (for example:
server1.domain.com, server2.domain.com, server3.domain.com etc.) by typing in browser or SSH by only passing the sub-domain name i.e.:
Here is /etc/resolv.conf from pc-freak.net
# cat /etc/resolv.conf
search pc-freak.net bergon.net
Here is example of what I mean, ascii-games is a sub-domain of pc-freak.net (ascii-games.pc-freak.net) and is resolved with no need to type full FQDN
# host ascii-games
ascii-games.pc-freak.net has address 188.8.131.52
The DNS server knows that all failed to resolve queries by set DNS should be searched (resolved) under the defined search domain, i.e. each DNS query for server2, serverX (would try to be resolved as a subdomain of domain.com).
Therefore, a very good question is what is Microsoft Windows (2000, 2003, 8) OS equivalent way to define search domain.com into /etc/resolv.conf?
In Windows the same /etc/resolv.conf hosts search is done using the so called "DNS Suffixes".
DNS Suffixes are used for resolv of (domain name strings with no dots).
Adding a new DNS Suffix in Windows is done from
Control Panel -> Network and Sharing Center -> Change Adapter Settings
Here select LAN card Adapter used to bring Internet to Win host,be it Local Area Connection or
Wireless Network Connection
Network Connection Properties
Internet Protocol Version 4 (TCP/IPv4)
and again click on
On next dialog click on
Advanced (button) -> DNS (tab)
DNS Suffix for this connection
fill in host which you would like to resolve with no need for FQDN and press the
(exactly like adding search pc-freak.net in /etc/resolv.conf on Linux host). Add multiple hosts DNS Suffix, if you want to access subdomains naming from multiple base domain.