DNS

Oct 13, 2022

Domain Names

Domain Names

Each host on the Internet is assigned an IP address, which is used by the Internet layer of the TCP/IP model to route data packets to correct hosts

In the IPv4 version of the Internet Protocol, these consist of 4 bytes of numbers, often represented in a form like 134.53.7.196

While computers are adept at using numbers like these, humans prefer friendlier names to help identify hosts

Domain Name

A domain name is a text string that maps back to an IP address, so that we can refer to a host by its name instead of its IP address Domain names exist within a hierarchy

TLDs

  • The top of this hierarchy is a nameless root domain that all other domain names are subordinate to
  • The next level down are called top-level domains (TLDs)
    • generic top-level domains (gTLD)
      • com, net, org, gov, edu, etc.
    • country code top-level domains (ccTLD)
      • us, uk, me, tv

More TLD

The number of top-level domains has increased over time

The Internet Assigned Numbers Authority maintains the list at http://www.iana.org/domains/root/db/ there are currently 1,591 registered domain root types.

Different organizations administer the top-level domains, with Internet Corporation for Assigned Names and Numbers (ICANN) administering the root and delegating authority out

  • edu: EDUCAUSE
  • com, net: VeriSign

TLD & Below

Below the top-level domains are the second-level domains which are typically available for end-users to reserve/register.

Below the second-level domains, exist third-, fourth-, fifth-level, and so on which are managed by the domain owner

Typical scenario

mymiami – specific purpose (www, mail, ftp, etc.)

miamioh – company/product

edu – top-level domain

Registration

Registration

Domain Name Registration is the process of getting a domain name added to the registry.

Users usually go through a registrar who has been authorized by the administering authority for a specific TLD which has been granted that authority by ICANN

  • ICANN – authority of the root domain
  • VeriSign – administers registry of .com
  • GoDaddy – registrar that VeriSign allows to assign names in .com

Registration

Registry information is available by the WHOIS service, which is run by the TLD administrator

When you register a domain name, you don’t get “ownership” of the domain, you get an exclusive right/lease to use it.

That said, domain names can be very valuable, with some of the transfers earning several million dollars

DNS

Early on

In the early days of the Internet, there were so few hosts on the network that users maintained the domain name -> IP mapping in a hosts file on the machine

As time when on, the number of domains increased it became difficult to maintain these hosts files

At the end of 2021 there were approx 341.7 million domain name registrations

DNS

The Domain Name System (DNS) is the solution to unwieldy hosts files and provides a hierarchical but distributed system to resolve domain names to IP addresses

  • DNS uses a client-server model where clients queries name servers to get information about a domain
  • Each domain has an authoritative name server which publishes information about the domain and its subdomains

DNS

DNS is distributed, which means there is no one server that holds all of the details of all the domain names

However, the hierarchy maintains which name servers might know the answer.

DNS

Without any caching, the lookups would looks like this:

  • Query one of the root servers to find out who is responsible for the TLD
  • Query the TLD name server to find out who is responsible for the second-level domain
  • Keep querying down until we get the final answer

Caching

Querying from the root name servers to the TLD name servers to the second-level name servers and beyond is inefficient, so a cache is often used where each domain will specify a time-to-live (TTL) to specify how long the result should be cached

If a domain name is to be changed to a different IP, administrators will often shorten the TTL to a short value in advance of the change so that the new IP is resolved as quickly as possible after the change

DNS Record Types

DNS Record Types – different types of resource records are stored in DNS; Examples:

  • A – address record, this is what is most commonly being sought in DNS; it returns the IPv4 address of a host
  • CNAME – canonical name; alias of another name
  • MX – mail exchanger; this is what we look up when we want to find the mail server for a specific domain
  • NS – name server record for this domain

Web Server

Web Server

A web server can refer to the physical server or the software that runs on the server; we’ll often use the term to refer to the software

A web server’s primary responsibility is to deliver web content to clients via the HTTP protocol

Additionally, web servers often support running server side code like the JavaScript and the Express things like we are doing right now