In resolv.conf, why do my search domains have a period after them?
What's the difference between server.com
and server.com.
in the search section of an /etc/resolv.conf
file?
user@host /etc/sysconfig/network-scripts $ head -n 3 /etc/resolv.conf
# Generated by NetworkManager
domain sub.company.com
search sub.company.com sub.company.com. company.com. company.com
Solution 1:
.
is the top-most point in the DNS hierarchy. com
, org
, net
, etc are all under .
. The reason that you don't see people type http://google.com.
into their browsers or other applications is that over time, applications have been developed to "help" you by not requiring it. A proper FQDN still has a period at the end, though it doesn't matter much in most cases nowadays.
When you have multiple search suffixes that can be appended to a DNS query, specifying a period at the end will stop your client from trying to "help" you by appended additional suffixes. It basically is saying "This is the full, entire address. Don't try and append anything else."
Solution 2:
Because fully qualified domain names always have a period at the end.
RFC 1034
Since a complete domain name ends with the root label, this leads to a
printed form which ends in a dot. We use this property to distinguish between:
- a character string which represents a complete domain name
(often called "absolute"). For example, "poneria.ISI.EDU."
- a character string that represents the starting labels of a
domain name which is incomplete, and should be completed by
local software using knowledge of the local domain (often
called "relative"). For example, "poneria" used in the
ISI.EDU domain.