DNS Servers, Roles and Functions: Domain Name Services
DNS Servers, Roles and Functions: Domain Name Services
When you want to call someone, you typically load up your contact list, tap their name
and hit call. You know that behind the scenes, this associates a phone number with the
contact, and your cellular connection initiates a phone call. DNS is your internet
phonebook. It lets you tell your browser to go fetch a domain name and automatically
know the physical IP Address, without you ever having to do more than hit the enter key
and wait. Make sense? I hope so. Let’s talk about how it works.
DNS Function
DNS relies on two major parts: a Nameserver and the DNS Records. The purpose of
a nameserver is explicitly to store information on how to find the DNS Records. When
your browser makes its request for a domain, the Nameserver it uses provides a
location to find details about the DNS Records. Without too much detail, a DNS Record
is what actually converts a URL (uniform resource locator, web address) into an IP Address.
Let’s take a look at the below example. You enter google.com into your browser. Your
browser reaches out to the root nameservers for any .com domain names from Verisign
(the root) and finds the nameserver for Google.com. That nameserver
is ns1.google.com. Now, that nameserver points you to the DNS Manager for the
domain, google.com. Upon checking, the DNS Manager provides 172.217.9.238 as
the DNS Record for google.com. Your browser then lands at the above IP Address
showing google.com’s site content.
DNS At Hostwinds
Hostwinds offers options to manage DNS Records for domains that are purchased here
or need to be managed in your Hostwinds Cloud Portal to point to your server. The
Nameservers we provide with your service control where your DNS Records are
managed. Let’s provide a couple of example scenarios:
Within our Shared Web hosting plans, your DNS Records are managed by your cPanel
account. To allow the cPanel account the ability to control your DNS, our Shared web
hosting plans are provided specific URLs to use as Nameservers. They will look
something like this:
seans1.hostwindsdns.com
seans2.hostwindsdns.com
These would be the nameservers you provide to your registrar, or, the location in which
you last paid for your domain. Once your domain is using these nameservers, your
cPanel account takes control of the DNS Records. You would edit them using the
DNS Zone Editor within cPanel.
The Cloud VPS hosting options provided at Hostwinds does not offer a default DNS
manager. Not all clients need this. As such, Hostwinds provides an external tool within
the Cloud Control portal. The Cloud DNS Manager acts as your DNS Records manager.
Nameservers that point to the Cloud DNS Manager look like this:
mdns1.hostwindsdns.com
mdns2.hostwindsdns.com
You would use these if you do not have a service or software running on your VPS that
manages DNS records. Adding DNS Records to the Cloud DNS Manager is a separate
step, and must be done manually in this case.
Private Nameservers
Whenever a nameserver is required, there is an option to create your own URL with a
domain you own. For instance, if you own the domain example.com, you could create
ns1.example.com and ns2.example.com. For domains purchased at Hostwinds, follow
our Private Nameserver Creation guide. Otherwise, take a look at our other guides that
feature other common registrars.
DNS Wrap Up
Chloe Tucker
Introduction
1. What DNS is and what it does
2. What DNS servers do
3. How Internet Protocol (IP) Addresses work in the context of DNS
Important concepts
There are some essential mental models to be familiar with when
learning about DNS, DNS servers, and IP addresses. Going over these
concepts now, before starting to learn about DNS, will
help make sense of all the different terms used to describe behavior
that fits into these models, and
aid in memory retention.
Mental models give you a frame of reference when things get a little
weird and unfamiliar.
Prepare for a lot of talk about servers. As it turns out, there’s a whole
lot of servers that go into this thing we call DNS, and how we, as
humans, use it when we connect to the Internet.
Client-server
relationship
What is DNS?
The Domain Name System (DNS) maps human-readable domain
names (in URLs or in email address) to IP addresses. For example,
DNS translates and maps the domain freecodecamp.org to the IP
address 104.26.2.33.
To help you fully understand this description, this section details:
This history is very abridged. If you’d like to learn more about these
topics, please reference the Resources section at the end of this article.
Now that we have some historical context, let’s move on to learning
more about domain names and IP addresses.
Domain Names
In the context of DNS, a domain name provides a user-friendly way to
point to non-local resources. This could be a website, a mail system,
print server, or any other server that is available on the Internet. A
domain name can be more than just a website!
URL: https://www.freecodecamp.org
Domain name: freecodecamp.com
TLD: org
SLD: freecodecamp
In the early days of ARPAnet, there were a limited number of TLDs
available, including com, edu, gov, org, arpa, mil, and 2-letter country
code domains. These TLDs were initially reserved for institutions
participating in the ARPAnet, but some later became available on
commercial markets.
Second-level domains are the domains that are available for individual
purchase through domain registrars (for example, Namecheap).
IP Addresses
While IP addresses are related to DNS in their function, the Internet
Protocol itself is technically separate from DNS. I’ve already provided
historical context for this distinction, so now I’ll explain how IP
addresses function.
104.26.2.33 (freeCodeCamp)
Example IPv6 address:
2001:db8:a0b:12f0::1 (the compressed format and not pointing to
freeCodeCamp)
The top of this graph, noted with a “.” is called the “root.”
“The authoritative name servers that serve the DNS root zone,
commonly known as the “root servers”, are a network of hundreds of
servers in many countries around the world. They are configured in
the DNS root zone as 13 named authorities.”
The root domain has a zero-length label.
From here-on down, each node (dot) in the graph has a unique label
up to 63 characters long.
The first level down from the root are the TLDs: the com, org, edu,
and gov. Please note that this graph does not contain a full list of
TLDs.
Below TLDs are the SLDs, the second-level domains. The children of
each node are called “subdomains,” which are still considered part of
the parent domain. For example, in freecodecamp.org, freecodecamp
(the SLD) is a subdomain of org (the TLD).
I wish I could tell you the folks in charge are called the “Namespace
Kings,” but alas.
Resolvers
In DNS, the client (the requester of information) is called the
“resolver,” which may seem backward at first. Wouldn’t the server
that is resolving the request be called the “resolver?” I thought so, too,
but it’s not. Best to just memorize that and move on.
Resolvers are typically included, de facto, in most operating systems,
so the applications installed on the OS don’t have to figure out how to
make low-level DNS queries.
DNS queries and their responses are types of DNS messages, and have
their own data transport protocol (usually UDP). Resolvers are
responsible for helping applications installed on the OS translate
requests for DNS-related data into DNS queries.
Back to Nameservers
Now that we are a bit more familiar with the client-side of the
relationship, we need to understand how domain nameservers respond
to resolver queries.
A Record: if you haven’t heard of any other RRs except for this one,
that would make sense. It’s likely the best-known RR and contains the
IP address of the given domain.
CNAME Record: if you haven’t heard of any other RRs except for
this one and the A record, that would also make sense. The “C” stands
for “canonical”, and is used instead of an A record, to assign an alias
to a domain.
SOA Record: this record contains administrative information about
the one, including the email address of the administrator. Hint: if you
administer a zone, make sure there’s a valid email address here, so
folks can get in touch with you if needed.
Other important Resource Record (RR) types are PR, NS, SRV, and
MX. Read about them here.
Caching and Time to Live (TTL)
When the local nameserver receives a response from a query, it caches
that data (stores it in memory), so next time it receives the same query,
it can just answer the query directly rather than go through the
original, longer resolution process.
But once this information is cached, it is both static and isolated, and
is therefore at risk of becoming out of date. Therefore, resource
records all have what is called a time to live (TTL) value, which
dictates how long that data can be cached. When that time runs out
(reaches zero), the nameserver deletes the record.
Important note: TTL doesn’t apply to the name servers that are
authoritative for the zone that contains the resource record. It just
applies to the nameserver that cached that resource record.
Source
First, it’s a backbone of the Internet, the thing many of us use, develop
feelings for (love/hate/you-name-it), and take for granted every day.
It’s important to be familiar with the structures that enable us to
accomplish great things today with technology and the Internet today.
Incredibly smart people spent decades of their lives building this stuff!
Let’s acknowledge and appreciate their contributions.
Now that I got the gushy stuff out of the way, it’s important to be
familiar with DNS concepts in case you’re responsible for anything
relating to infrastructure in your company or team or your own
business. Having a frame of reference when significant issues crop up
allows you to act that much faster and find solutions that much sooner.
Conclusion
At this point, you should understand what DNS is and what a
nameserver is, as well as be familiar with technical concepts relating
to IP addresses.
Many books have been written about and dive deeper into the
fascinating world of DNS, and there is so much more to learn. The
topics that were not included in this article but are either part of DNS
or very related include:
Nameserver implementations
Forwarding
(More about) node labels
Primary and secondary nameserver relationships
Retransmission algorithms
Load balancing
Plus, other more general topics about the how the Internet functions,
like:
World Wide Web
HTTP
FTP
Communication protocol layers: link layer, IP layer, transport layer,
Internet layer, etc.
For those of you who are still reading and want to learn more about
DNS, I first and foremost recommend “DNS and BIND, 5th Ed.”,
written by Cricket Liu and published by O’Reilly Media. It’s
invaluable.
I also encourage everyone to poke around in the original Request for
Comments (RFCs) linked below. Not only are there points for reading
primary sources, but they’re also exceptionally well-organized and
comprehensible documents, which is why I quoted them in this article