1

When specifying the $ORIGIN directive in a DNS zone file if what you are specifying is a FQDN (fully qualified domain name) then by definition it should end in a trailing dot (for example $ORIGIN example.com. instead of $ORIGIN example.com). That makes sense since the trailing dot unambiguously indicates that the "com" or other top level domain is subdomain of the DNS root (which has a blank name or "" and is separated from the top level domain by the dot).

But in a BIND config file (in modern versions called named.conf), a zone name is labeled without the trailing dot like this:

zone "example.com" IN {
    type master;
    file "master.example.com";
}

Notably if an $ORIGIN directive is not specified in a zone file then $ORIGIN is implicitly assumed (by BIND) to be the zone name specified in the named.conf file. From my observations it seems that BIND adds the trailing dot to $ORIGIN when it is assumed from the zone name.

My question is why do you specify a zone name without the trailing dot? Why isn't the zone name above specified as zone "example.com."? Isn't "example.com" a technically ambiguous identifier for the zone name?

1 Answer 1

0

It's not really ambiguous. When you define a zone, the string between the quotes is the zone. If it's taking the string you provide exactly as is, then a trailing dot isn't really required.

Using the trailing dot only really comes into use inside the zone file. By automatically adding $ORIGIN to any entry in the file, it saves you from having to constantly keep entering the zone name over and over again. If you do need to use an FQDN, such as for a CNAME pointing to an external domain, you just add the dot.

1
  • Then how would the DNS know when it has reached the end and not send it the query up the chain of command? May seem to work under almost all cases except for when DNS is slightly misconfigured in your house.
    – rjt
    Apr 26, 2023 at 19:10

You must log in to answer this question.

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