-1

[RFC1035] defines <domain-name> as

<domain-name> is a domain name represented as a series of labels, and
terminated by a label with zero length.

This means a <domain-name> must be a FQDN of the form an.example. with a terminating '.'. Also, according to this RFC CNAME and MX EXCHANGE RDATA must be a <domain-name>.

According to Wikipedia [wiki] zone files may contain relative entries like

wwwtest IN CNAME www

which I also have used several times. So, who is wrong?

Sophie
  • 117
  • 4

2 Answers2

1

You are. Non-canonicalised hostnames in BIND zone files are automatically qualified with the domain name in question. When you write

wwwtest      IN      CNAME      www

in example.com's zonefile, BIND is turning the canonical name into www.example.com without asking you.

This has been known to lead to sysadmins putting entries in zonefiles for, e.g., example.com, which read

www      IN      CNAME      hosting-server.isp.example.co.uk

and then getting all surprised when their clients complain that browsers keep returning hostname hosting-server.isp.example.co.uk.example.com not found errors.

MadHatter
  • 79,770
  • 20
  • 184
  • 232
0

Yes, I am. The actual answer is that my <domain-name> is only valid for Section 3 of the RFC. In Section 5, page 34 <domain-name> is defined for master files (zone files):

<domain-name>s make up a large share of the data in the master file.
The labels in the domain name are expressed as character strings and
separated by dots.  Quoting conventions allow arbitrary characters to be
stored in domain names.  Domain names that end in a dot are called
absolute, and are taken as complete.  Domain names which do not end in a
dot are called relative; the actual domain name is the concatenation of
the relative part with an origin specified in a $ORIGIN, $INCLUDE, or as
an argument to the master file loading routine.  A relative name is an
error when no origin is available.
Sophie
  • 117
  • 4