Skip to main content

Domain Name System


aliases:

  • DNS

The naming system used by computer networks to match human-readable domain names to IP addresses.

DNS is a hierarchical naming system, meaning it organizes everything from the first level (called the DNS Root), branching out into the different top level domains (e.g. the .com in www.google.com). From there, it's branches into all the different Domain Names (e.g. the .google in www.google.com). The website owner is responsible for maintaining the domain name. The hostname refers to the specific hosts on the network. On an internal network, this might be server1.mycompany.com, but on the Internet, it's typically www.google.com.

  • DNS Root (.com, .net, .org)
  • Top Level Domain (`.google, .battle, .wikipedia)
  • Domain Name (server1., na., www.)

Registering a domain means giving the appropriate IP addresses of our registered web servers to the many other servers that keep track that data. There are millions of domain names for every single TDL, and they need to be able to give the address of our web server to any hosts reaching out if we want people to be able to access our webpage.

DNS Records

When configuring a DNS server, the network administrator also has to setup all the records, which define the DNS zones being created (the section of the DNS that manages a specific domain and it's corresponding subdomains).

Record Type Usage
A Maps hostname to IPv4 address.
AAAA (Quad-A) Maps hostname to IPv6 address.
Pointer (PTR) Maps IPv4 address to hostname.
Canonical Name (CNAME) Maps an alias to it's proper domain name.
Mail Exchange (MX) Identifies email servers (requires an A or AAAA record to work)
TXT Stores plaintext notes in a DNS zone
Start of Authority (SOA) Stores information about the authoritative name server for the zone
Service (SRV) Stores information for a specific service, being a host and a port

When troubleshooting network issues, note that the DNS server has to be on the same subnet as the host to avoid limited connectivity issues.

DNS servers store their records in forward lookup and reverse lookup zones. While forward lookups are normal DNS stuff, i.e. asking for the IP address related to a domain, reverse lookups are a bit weirder. Reverse DNS queries ask the server for the hostname related to an IP address, and they use a special domain, using the:

  • (IPv4) first three octets of the IP address in reverse, ending with a .in-addr.arpa
  • (IPv6) all of the 32 hex characters in the IP address in reverse, ending with a .ip6.arpa

Name Resolution w/ DNS

When a user requests for data behind a FQDN, often a web browser or application program, the host checks it's local cache of domain names for the IP address. If it doesn't have it, it asks the local DNS server for it. If that doesn't have it, the local DNS server reaches out to the authoritative name server for the requested domain. Authoritative name servers do not reach out to other name servers until the information is found and received or the request is timed out, they just sit there and say 'nah I don't got it' if they do not have the information.

There are two more layers of name servers beyond the authoritative name server. The TLD name server isn't authoritative, but it returns the name server for the domain name requested. Beyond that is the root name server, which points to the TLD name server.

If the lookup process ends with an authoritative domain server not having information about the requested domain, this process is known as an iterative lookup. If the lookup process ends with a queried name server reaching out to other name servers until the domain is resolved, this process is called a recursive lookup.

#XI