DNS Fundamentals From A Technical Perspective
DNS Fundamentals From A Technical Perspective
DNS
FUNDAMENTALS
From a Technical Perspective
Introduction:
Understanding fundamental Domain Name System (DNS) concepts is a
critical part of your understanding of how the internet works. DNS is the
mechanism that helps find the network endpoint that you’re trying to
reach. This paper will cover basic DNS terminology, in general terms,
with nothing vendor-specific or proprietary. There are many opinions on
this subject, so this paper will lay out multiple points of view, wherever
possible. The goal is to provide a good representation of all these terms
and how they function in the real world.
Global DNS
Let’s begin by defining the actors on the stage. The DNS can really be
broken down from a request perspective: There are authoritative servers,
and there are things that talk to those authoritative servers. Often, the
things that talk to the authoritative servers are doing it on behalf of
someone else, which are “stubs.” As we’ll discuss later, there are a number
of things you can be authoritative for.
This can’t possibly be repeated enough: users are our eyeballs on the
edge of the internet accessing internet resources. Whenever we hit a URL
like http://www.dyn.com/blog, our devices parse it out into multiple parts.
Your browser first uses DNS to look up the target hostname’s IP address
(or the URL may have an IP-literal hostname that directly specifies an IP
address, skipping DNS altogether). The URL has some distinct parts. The
beginning is the scheme. In general terms, it says which protocol is in use
(in this case, http).
After the two slashes comes some network location information, which
is almost always an Internet host expressed as a domain name that can
be looked up in the DNS. In our example, this is www.dyn.com. There
are other kinds of information that can be here, too, but a domain name
is most common. After another slash comes the path (in this case, blog)
which says where the desired resource is found on the host. To get to the
blog, you must know how to find the host on the internet. This is where
the DNS comes in, using a process called name resolution.
When you register a domain, a few things happen. You register the
domain, which designates the DNS namespace of that domain—and
all its children—to you. This may initiate the process to create a DNS
zone, a unit of DNS administration. The registration of the name, if
it’s permitted, creates an allocation of that name space. But there’s
no requirement to add nameservers. And if you don’t, you have a
name without a delegation. If you add at least two nameservers—and
assuming everything else is ok—you have a delegation (that is, a pointer
in the parent zone to your nameservers).
That is, if .com delegates example.com, there can only be one example.
com zone. example.com could further delegate, to a.example.com and
b.example.com, by adding nameserver entries at those names. But that’s
not at the registered domain—but at a different domain (a.example.
com, for instance). And the operator might not even be different for
these different zones—you can delegate something to yourself (that is,
to another nameserver that you control).
When you register that domain, one of the things the registrar will ask is specifies the exact location (www.example.com.) in the DNS tree
which DNS servers will act as the authority for your domain. This acts to where a particular record can be found. This is often called the
delegate the authority of your domain to your own authoritative DNS “name” of the record or a “host” in various DNS portals, but it is
servers, exactly as the root delegated the TLDs above. Do you sense a more properly called a domain name.
pattern? It’s “turtles on turtles” all the way down. But, it can get a little
confusing, because all of these things are called domain names and The next value is the Time to Live (TTL), which is the maximum value
are delegated, so it is not always clear whether two domain names are the record should be held in cache before a new query occurs. The
under the control of the same operator. record type lets us specify what kind of data goes in the record: some
take IP addresses, some take domain names, one can take arbitrary
Let’s review before we get into the terms used to manage a zone at a text (TXT), and so on.
DNS provider on a day-to-day basis. We registered a domain, which
created a zone, via a registrar, acting for a registry of a TLD, which is Not represented in a standard BIND zone file is the record class,
a division of the DNS namespace below the root, through a process which is nearly always IN for internet. There is also an option for CH
of delegations—all in order to provide answers to users through their for Chaos network, but is only really used by us DNS personnel to
recursives to our domain authoritative DNS. query DNS server information. Lastly, we have the meat of the record
known variously as RDATA for Resource Data, Value, or sometimes,
What’s in a Zone? target. A group of all the records of a particular type with the same
name and class exist as an RRset.
So far, everything has been largely behind the scenes and broadly
Some of the specific terms used to describe a scope for any
consistent across the industry. It’s really when things start being
location within the DNS tree are contentiously debated, both across
presented to users themselves that terminology starts to get squirrelly.
organizations and within them. If the description below doesn’t match
The terminology used by implementers and developers of DNS
what you might be used to. we will try to provide some context for
protocols, and by operators of DNS systems, has changed in the
the discrepancy.
decades since the DNS was first defined.
The first is the location at the very top of that zone - the apex,
For the next set of terms, we should build a zone with just a few of the
represented by the @ symbol in our zone file, with the SOA record
normal records we use on a day-to-day basis. Records are formally called
designating the Start of Authority (SOA) for the new zone with
Resource Records (RR), which are those individual entries in the zone.
information on how to handle that zone in certain scenarios. The apex
of a zone is the name of the location (“node”) where the SOA record
If you’re just starting to become familiar with DNS, you may notice that
is located. There is always at least one nameserver record at this
different types of RRs have different kinds of data: we have IPs (A for
location, too. If the zone name was example.com, then the apex of
IPv4 and AAAA for IPv6) for things like webservers for the blog and
that zone is also example.com, which may hold important records like
APIs, mail servers; Mail Exchanger (MX) record for inbound mail; and a
TXT or MX for email functionality.
Service Record (SRV) for Voice over IP (VoIP).
While this is sometimes called “the root of the zone,” this should be
The terms for various portions of the individual record are not too
discouraged, if possible. The root is a specific location at the root of
controversial. Each string between the dividing dots (www, example,
all DNS names. If you think about it, it’s as if you referred to the home
com) are known as labels. The labels together form a DNS name that
directory on your computer as “root.” People wouldn’t know if you meant that
location or actual root. That term is taken, and we have one for this concept,
the apex.
Everywhere there is an SOA record, that is also an apex in the DNS distributed
database. Domains can have “subdomains”: that is just the relationship
between two names. For instance, the example.com domain can have a
subdomain, a.example.com. Also, example.com is a subdomain of com, and
they’re all subdomains of the root zone.
Every domain name might have several resource records RRsets: SOA if the
name is an apex, NS, A, AAAA, MX, TXT, or other types. And the example.
com zone might also have subdomains in it, because not every subdomain is a
delegation. So, in the example.com zone file, you might find entries for a.long.
domain.name.example.com.
The next attempt uses Fully Qualified Domain Name (FQDN) to refer to the
entire string of labels with all parts. This is reasonably good, but there is an
issue with the full qualification. A true FQDN must include all labels right down
to the trailing root (www.example.com.). But on a day-to-day basis, most of us
will present a domain name without the trailing dot (www.example.com). Does
a FQDN include situations when the trailing dot is excluded? We find ourselves
in a situation where many outside the DNS sphere haven’t heard the term, but
DNS experts are stuck wondering if it really is or isn’t qualified.
The other major term is hostname or host name; both mean the same thing.
As RFC 7719 points out, the DNS was born out of the use of host tables, so it
is likely this term has existed since nearly the beginning and is in common use.
There is a flaw, however. Technically speaking, not all FQDNs can be hostnames.
Host names are only allowed to contain letters a-z (or A-Z), digits 0-9, and the
hyphen. Domain names, on the other hand, can have special characters such as
the underscores for _udp and _sip for our SRV record. There is a set of rules—
discussed in detail in RFC 7719—for what may be a hostname.
DNS Delegation
So far we have covered the major components of a single zone and Google initially knows the names of the root nameservers because
zone file, but the DNS is actually a series of delegations: the root they are hard-coded into the hints file. Otherwise, how do you know
. zone to the .com zone to the .example.com zone. How do those where to start? The root zone looks at the request for dyn.com. and
zones link together? This is done by that process mentioned earlier, notices that it is in the com namespace. There is a label for com in
delegation, in which one zone points the authority to the next in the root zone, with 13 nameservers as NS records. The nameserver
the chain. The process for dyn.com looks like this using my own records found in the zone performing the delegation (root in this
computer through Google DNS: case) are known as the parent nameservers of the delegation. The
inclusion of these nameservers at this spot indicates the answer to
this query is not on the current nameserver or zone, and the resolver
should try the ones provided.
This produces a zone cut to a new zone within the new delegated
zone. At the location of those 13 nameservers, there is a zone file
for the domain of com, with a Start of Authority (SOA) record so
indicating. Along with the SOA, there are 13 nameservers in the
apex of the com zone signaling that you are in the right place. These
are known as the child nameservers of the delegation. The recursive
follows this process, again and again, until it gets to the authoritative
for the DNS name in question and “voila!” gets the answer.
It’s true that, in most top-level domains (TLDs), just like everything else that
goes into the registry’s zone, the glue records must be added by
your registrar.
It is, therefore, highly advisable that your parent and child nameservers
match on both sides of the delegation, with all nameservers correctly
responding. Of course, sometimes they can be different, in order to allow
you to change nameservers. But, as a general rule, they should be the same.
If you look at the example above, you will see the last two sections are
almost identical, with a small but noticeable difference. “Matching RRsets”
means: the algorithm in DNS doesn’t compare TTLs when looking for a
match. It just looks at name, class, and type.
This parent NS TTL set by the parent (including the TLD nameservers)
within the parent zone, and there is nothing a child domain operator can
do about it.
DNS Administration
We have a zone on a single provider with our answers. What happens if that
provider has a problem? A very common topic is that of multiple provider
DNS configurations. While the specifics have been covered in depth in a
different piece, the terms related to that process belong here.
In order to have multiple providers, the zone files between them must
be in sync, as any nameserver in the delegation might receive the traffic.
Historically, this has been performed by a process of a Master DNS server
which handles zone file management updating a Secondary DNS server.
Today this is performed by letting the secondary know there is an update via
a NOTIFY which activates the secondary to compare the serial value in the
SOA record which designates the version of the zone.
If the master serial is higher, it is time to update. The secondary may initiate
an IXFR to get the changes that have occurred between those two serials,
or will perform an AXFR for the whole zone in cases where the number of
changes is too large or this is the first time loading the zone, or if it does not
support IXFR. Because this update process is a sensitive one, a Transaction
Signature (TSIG) can be used to ensure the master DNS server really is who
it says it is by way of a symmetric key verification.
To start the process off, if the resolver is just getting the delegation for
the first time it will merely pick one randomly and send the first query off.
After that, it might continue using that same name server. To improve
performance, however, it may then mark down the Round Trip Time (RTT)
– the time between when the query was sent until the reply was received.
It may then send the next query to one of the other unknown
nameservers and repeat the process until all the known
DNSSEC
nameservers have a round trip time associated with them.
As more actors began to use the internet, malicious parties began
to take advantage of its open nature. To ensure the fastest possible
Many resolvers will then use these times to send more traffic to
response, DNS uses UDP packets, rather than establishing a TCP
the fastest nameserver. This is called nameserver affinity, or a
connection. While there is a gain in speed, it is also easier to spoof
preference for some NS over the others. This accelerates responses
the packet address. Additionally, resolvers historically used the
for users and reduces some process time for the resolver. In order
first response to come in. These features combined to establish an
to adapt to changes, resolvers will periodically test the nameservers
environment in which the DNS lacked security. If you are going to
that responded more slowly to see if an improvement has occurred.
yourbank.com, you really want it to be the right location, right?
Each resolver around the world is configured to point to an initial trust anchor of
the Root public KSK. The private Root KSK is used to sign the Root RRSIG of the
DNSKEY RRset. Because this signing process is so critical to the security of the
DNS, no single individual, organization, or nation was trusted to perform
the signing.
But wait! There’s more! Another way in which malicious actors may spoof a zone
is to pretend to have access to a host that doesn’t exist within a zone. In this
scenario, the response will be the absence of a record, not an explicit declaration
that the record doesn’t exist. This has been documented as a method for spoofing.
To combat this, NSEC records which point to the next valid host were created,
thereby proving the lack of existence of anything in between. The problem there is
that it becomes possible to walk the zone and know everything which does exist.
While DNS is public information, and private information shouldn’t be published in
the first place, this worried people enough to create NSEC3 records which change
this into a hash. There is even a proposal for NSEC5 which likely works by wizardry
and unicorn dust alone. As we’ve seen, DNSSEC isn’t easy.
Wrapping It Up
This paper’s goal was to provide the information needed to help you better
understand how all these pieces fit together. If you have questions as you find
yourself staring down a long block of DNS, contact Dyn. We will be happy to help.
If you are interested in reading more, here is a list of all the DNS Requests for
Comment (RFC) at the Internet Systems Consortium (ISC) who write BIND, the
most widely used DNS software on the internet. For DNS terminology specifics,
RFC 7719 has the definitive list. And if you’re interested in learning more about
why it’s time to rethink DNS, visit dyn.com/dns.