41

When I edit my bind dns records, I need to add a trailing period for it to work. What is the point of this?

How come when I use everydns.net, they do not require me to add a trailing period?

Is this an implementation quirk?

1
  • What a great question. I never really paid attention to that dot, but the answers here have been very educational (in content and syntax). Jun 3, 2009 at 19:38

8 Answers 8

33

DNS itself has a root zone. this zone it called literally ".". Bind requires that you fully qualify a DNS name (this includes the . or root zone). Other UIs simplify this by assuming the root zone for you.

Within Bind, you may define a variable ORIGIN that will be automatically appended if you do not specify a FQDN (Fully Qualified Domain Name, including the trailing .). Alnitak has an excelent example of the syntax and various uses of this.

3
  • Actually, you can define the $ORIGIN variable to fully qualified your hostnames. Look at Russell Heilling and Alnitak comments below.
    – Benoit
    Jun 3, 2009 at 10:37
  • Very good point. I'll edit to add something regarding that fact. Jun 3, 2009 at 14:18
  • 2
    The root zone is not called .. It is an empty label.
    – bzeaman
    Mar 6, 2017 at 21:35
26

The trailing '.' makes the name into a "Fully Qualified Domain Name", i.e. an absolute domain name.

In standard "master file format" files if you don't add the trailing '.' then the name is assumed to be relative to the current zone file's $ORIGIN (which is either specified in the zone file as shown below, or taken from the zone statement in named.conf otherwise).

i.e.

$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
1
  • 3
    Remember also that ORIGIN, if not specified in the zone file, is defined implicitly by the name of the zone served.
    – bortzmeyer
    Jun 4, 2009 at 10:14
10

The . makes the name be relative to the root, without it, it the name will be relative to the current zone. The standard zone format is defined in rfc1035 and rfc1034.

How come when I use everydns.net, they do not require me to add a trailing period?

Is this an implementation quirk?

Yeah, it sounds like easydns.net is doing it a bit quirky.

3
  • 2
    strictly speaking it's called "fully qualified", not "relative to the root".
    – Alnitak
    Jun 3, 2009 at 6:55
  • Sort of like the difference between specifying /var/log and var/log Jun 3, 2009 at 14:53
  • no, more like the difference between /var/log, and log, if the current directory is /var
    – Alnitak
    Jun 3, 2009 at 15:09
6

If you do not enter the trailing "." then the server will add the value of $ORIGIN to the end of the record. This can be a very useful shortcut and save a lot of typing if used well.

Unfortunately it is also easy to forget the "." which can result in hard to diagnose problems.

Technically the "." on the end of a record such as www.serverfault.com. indicates the separator between the "com" gTLD and the "" root zone.

3

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.

The reason why you didn't have to with everydns.net is because they probably wrote their UI so you didn't have to worry about this technical detail.

2

In an fqdn, the dots are the actual identifiers. "com" and "edu", "hp" and "stanford" are just arbitrary delimiters. The dot's are uniquely identified by their spin.

2
  • 2
    Forgive me, serverfault, that silliness just came into my head as I was trying to wrap my head around the dns-root-level concept I had read about so long ago. I think one way to think of it is that the DNS root level is basically a null string. So, if you want to be fully qualified, you have to add a dot. If DNS were designed by a large commitee or Microsoft, the top level would be "top" or something, and you'd have to add ".top" to an FQDN. Decide for yourself which would be more of PITA.
    – Bryan Seigneur
    Jun 2, 2009 at 20:08
  • What about the dots' spin? :P That was so random...
    – shylent
    Jun 2, 2009 at 20:27
2

The original designers wanted to be able to specify hosts in zone files with a minimum of typing, therefore it defaults to appending the zone to each entry unless fully qualified with a trailing dot. This is an implementation quirk that everydns.net realizes leads to newbie errors and confusion; therefore they eliminated it.

1

The short answer.. Well, has honestly already been documented here. :) Basically and put succinctly, "It says so in the RFC, mate."

Have a look at this link

"No, that dot in the domain name of the URL is not a mistake."

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .