DNS resolution often known as domain name lookup, it is the process of translating human-friendly domain names into machine-readable IP addresses. The DNS information is heavily cached in real-live, they are temporarily stored on various levels of the DNS infrastructure (i.e. DNS resolvers, authoritative nameservers) and dynamically updated to reduce DNS resolution time.

DNS hierarchy

Domain names are organised in a hierarchical structure, the DNS resolution utilises this hierarchy to efficiently find the IP addresses. The hierarchy divides domain names into zones that each zone represents a portion of the overall hierarchy and has specific authority with a nameserver (authoritative nameserver) for managing the domain name records within that zone.

The domain name is like file path but in reverse order, for example www.sydney.edu.au

  1. Root level At the top of the hierarchy is the root level, it represented by a single dot (.) although it is usually omitted when typing domain names.
  2. Top-Level Domains (TLDs) Below the root level is the TLDs
    • Country Code TLD (ccTLD) .au, .us, .eu are ccTLD, they are specific to individual countries or territories.

    • Generic TLD (gTLD) .com, .org,.edu are generic TLD, each TLD is responsible for managing domain names within its namespace. For example .com is managed by Verisign, .org is managed by Public Interest Registry.

  3. Second-Level Domains (SLDs) Beneath TLDs is the SLDs, which are chosen by individuals, organisations, or institutions.
  4. Subdomains The SLDs can be divided further into subdomains. Subdomains are additional levels of hierarchy, such as organising web services or departments within an organisation.

In www.sydney.edu.au:, the root level is . which won’t display; the ccTLD is .au; the gTLD is .edu; the SLD is .sydney; and the subdomain is www

Nameserver

A nameserver is a crucial component in DNS resolution. Nameservers store DNS records for specific domains. Nameservers are organised according to DNS hierarchy, with the root server at the top, followed by authoritative servers for each subsequent levels. The DNS resolver often perform recursive DNS resolution by sending requests to nameservers at different level of the DNS hierarchy. (More details on DNS Nameserver)

DNS record

A DNS record is database entry that contains information about a domain name. DNS records are used to map domain names to their corresponding IP addresses. There are different types of DNS record. (More details on DNS Record)

Network configuration

When you started your computer and connect it to the internet, it needs to obtain essential network configuration information. These configuration included you computer’s IP address and the IP addresses of a DNS resolver or nameservers that your computer should use for DNS lookup. To fetch this configuration, your computer needs to send out a DHCP request.

Dynamic Host Configuration Protocol (DHCP)

DHCP is used to automate the process of assigning network configuration to devices on a IP network. Your device will send out a DHCP request in the form of a broadcast packet that requests configuration information from any available DHCP server. The server responds with a message that contains the network configuration information.

Time-to-Live (TTL)

Each DNS record in a domain’s DNS zone contains a TTL value. This TTL value is specified in seconds and indicate how long the DNS information provided by that record in considered valid. When a DNS resolver queries a DNS authoritative nameserver to resolve a domain name, it receives the DNS record for that domain along with their associated TTL value.

Caching

The resolver starts a countdown timer based on the TTL value. During the time the resolver considers the information valid and doesn’t query the authoritative nameservers again for the same domain. Instead it uses the cached data to respond to subsequent queries for that domain.

TTL expiry

When the TTL timer expires, the cached DNS records are considered stale. At this point the resolver must query the authoritative nameservers again to obtain fresh DNS information. The resolver the updates its cache with the new data and starts a new TTL countdown.

DNS resolution process

This process is simplified.

  1. Preconfigured Nameserver Your computer is preconfigured with the IP address of a DNS resolver or nameserver.
  2. Send query using DNS Protocol When your system wants to resolve a domain name into an IP address, it sends a DNS query to the preconfigured nameserver using the DNS protocol. The DNS protocol sends messages using the UDP.
  3. DNS Resolver The preconfigured nameserver receives the DNS query over UDP. It then processes the query, either by providing the IP address directly from its cache (if the IP information is already cached in DNS resolver) or by recursively resolving the query, following the DNS hierarchy until it finds the authoritative DNS server for the requested domain.
  4. Response Once the DNS resolver obtains the IP address associated with the domain name you queried, it sends the response (requested IP address) back to your computer using UDP.

Back to parent node: Domain Name System (DNS)

Computer_networksINFO1112IP_modelApplication_layerDomain_Name_System_DNSDNS_resolutionInternet_Protocol_IPDNS_hierarchyDNS_recordNameserverDynamic_Host_Configuration_Protocol_DHCPTop_Level_Domain_TLDSecond_Level_Domain_SLDSubdomain