Friday, December 3, 2010

DNS: trailing periods

SkyHi @ Friday, December 03, 2010
The trailing '.' makes the name into a "Fully Qualified Domain Name", i.e. an absolute domain name.

The trailing dot tells the DNS server that this is a fully qualified name. The dot is the root of the DNS heirarchy. If you don't use the dot, the DNS server will assume that it's a record in the current zone and will append it for you. For example, if you have a CNAME in exmaple.com that points to host.example.org, when you query for that, you'll get host.example.org.example.com, which probably isn't what you wanted.


In Bind config files if you don't add the trailing '.' then the name is assumed to be relative to the current zone file's $ORIGIN.


$ORIGIN example.com.
mail           IN A      192.168.1.1
mail2         IN A      192.168.1.2
server      IN A      192.168.1.3
@             IN MX 10  mail                       ; not FQDN - example.com. appended
                IN MX 20  mail2.example.com.     ; FQDN 
                IN MX 30  mail.example.net.      ; FQDN in another domain
                IN MX 40  mail2.example.net      ; ERROR - not FQDN - example.com appended
www      IN CNAME  server                    ; not FQDN - example.com. appended




REFERENCES
http://serverfault.com/questions/18113/dns-trailing-periods