Tuesday, July 25, 2023

Domain Name Space

Understanding DNS Hierarchy: Complete Guide to Domain Name Space

Understanding DNS Hierarchy: Complete Guide to Domain Name Space

🎯 What You'll Learn:
Understand the DNS hierarchy structure, from root level domains down to individual hosts. Learn how domain names are organized, interpreted, and resolved through the inverted tree structure of the domain name space.

What is DNS Hierarchy?

The DNS hierarchy, also called the domain name space, is an inverted tree structure. The DNS hierarchy tree has a single domain at the top of the structure called the root domain – indicated by the "." as we have mentioned. Below the root domain are the top-level domains that divide the DNS hierarchy into segments containing second-level domains, sub-domains, and hosts.

🔑 Key Concept:
Think of DNS hierarchy as an upside-down tree where the root is at the top and branches extend downward to reach specific hosts. This structure enables efficient name resolution and delegation of authority.

Five Levels of DNS Hierarchy

The DNS hierarchy is comprised of the following five levels:

Level Description Example
1. Root Level Domain The top of the hierarchy, represented by a dot (.) .
2. Top Level Domains (TLD) First level below root (organizational or geographic) .com, .org, .uk, .ca
3. Second Level Domains (SLD) Registered domain name below TLD rjsnetworkcloudacademy
4. Subdomains Optional third-level domains for organization www, blog, mail
5. Hosts Individual devices or servers myserver, webserver1

Within the hierarchy, the resolution process starts at the Root Level DNS, the Top-Level DNS, working its way down to the Second Level DNS, then through any number of sub-domains until we get to the actual hostname we want to resolve into an IP address.

DNS Architecture

⚠️ Important:
Domain Name formats are examined from right to left because that is the direction that a domain name is interpreted. This is contrary to the way we type a domain name into a browser from left to right.

For instance, www.rjsnetworkcloudacademy.com domain names are interpreted by DNS the other way around, from right to left.

Components of a Domain Name (Labels)

  • The first component for domain name starting from right to left is the Root represented by a dot.
  • After the Root comes, the Top-Level Domain (TLD). We will not go into depth now at this stage, since there's going to be an entire module dedicated to TLD further.
  • What follows a Top-level domain is the second level domain, which in this case is rjsnetworkcloudacademy.
  • The second level domain, along with a Top-level domain, make the Zone apex otherwise known as Naked domain or Apex domain.
  • Finally, the third level domain is usually something like www, which is more of a naming convention rather than a necessity, if it came down to creating a domain name for, say, your website.
Understanding Labels:
  • The components of a domain name are known as Labels
  • Root is said to have a Label of Null
  • Each label is a subdomain of its parent domain
  • For instance, www is a subdomain of rjsnetworkcloudacademy.com, while rjsnetworkcloudacademy is a subdomain of the .com top-level domain
The entire domain name stretching all the way from the Root down to the third level domain is known as the Fully Qualified Domain Name (FQDN), which is the absolute reference to a domain name.
Why Different Dot Colors? The reason why the dots representing the root is colored differently to the other dots is because the first is a special dot, while the other dots serve as the limiters separating the labels of a domain.

3. Domain Name Syntax Rules

A few more things to keep in mind in relation to the syntax of a domain name:

Rule Description
Label Length Each label can be up to 63 characters long
Allowed Characters A-Z uppercase/lowercase, digits 0-9, and hyphen (-). This is known as the LDH rule (Letters, Digits, Hyphen)
Hyphen Placement Labels may not start or end with a hyphen
TLD Restriction A top-level domain name should not be all numeric
Subdomain Limit No maximum limit on the number of subdomains
Total Length A domain name can be up to 255 characters in total, including the dots
LDH Rule: Letters, Digits, Hyphen – these are the only characters allowed in domain labels. No spaces, underscores, or special characters are permitted.

4. Root Level Domains

The DNS root level is the highest in the DNS hierarchy tree because it is the first step in resolving a domain name. The root DNS server is the DNS for the root zone. It handles requests for records in the root zone and answers other requests by providing lists of authoritative name servers for the appropriate TLD (top-level domain). These are the authoritative nameservers that serve the DNS root zone. These servers contain the global list of the top-level domains.

Root Zone Contents

The root zone contains the following:

  • Organizational hierarchy – such as .com, .net, .org, .edu
  • Geographic hierarchy – such as .ca, .uk, .fr, .pe
13 Root Name Servers:

Currently, there are 13 root name servers specified, with logical names in the form "letter.root-servers.net", where letter ranges from "A" to "M" and represent companies like Verisign, University of Maryland, NASA, and The Internet Corporation for Assigned Names and Numbers (ICANN).

Modern Infrastructure: Previously, there were only single servers for each of the 13 IP addresses. Today, there are server clusters for each of them meaning there are hundreds of servers all around the world. They use Anycast DNS routing for load-balancing and better-decentralized performance.

5. Top-Level Domains (TLD)

The next level in the DNS hierarchy is Top-Level Domains or TLDs, for short. There are over 1000 TLDs covering everything from ".abb" to ".zw" and still growing. As we have seen, the TLDs are classified into two subcategories: organizational hierarchy and geographic hierarchy.

TLD Category Description Examples
Organizational Hierarchy Divided into domains for commercial enterprises, government entities, educational institutions, and nonprofit organizations .com (commercial)
.gov (government)
.edu (education)
.org (organization)
Geographic Hierarchy Represents the country where the domain is hosted (country-code TLDs) .ca (Canada)
.uk (United Kingdom)
.au (Australia)
.aq (Antarctica)
Combined Hierarchy Organizations using both organizational and geographical hierarchies for local customers .com.et (Ethiopian business)
.org.al (Albania organization)
.gov.it (Italian government)
TLD Growth: Organizations that want to cater to their local customers can opt for TLDs that use both organizational and geographical hierarchies. This allows for better targeting and local presence in specific markets.

6. Second-Level Domains

A domain is a second-level domain if it is contained within a top-level domain. A second-level domain is a label – usually, a name related to the website or the business that owns it – immediately to the left of the top-level domain and separated by a dot.

Definition: In the Domain Name System (DNS) hierarchy, a second-level domain (SLD or 2LD) is a domain that is directly below a top-level domain (TLD). For example, in "rjsnetworkcloudacademy.com", "rjsnetworkcloudacademy" is the second-level domain of the ".com" TLD.
Full Domain Second-Level Domain Top-Level Domain
rjsnetworkcloudacademy.com rjsnetworkcloudacademy .com
google.co.uk google .co.uk
github.io github .io
amazon.ca amazon .ca
Business Identity: The second-level domain is typically where businesses and organizations establish their brand identity online. This is the part you register and pay for when purchasing a domain name.

7. Subdomains

A subdomain – sometimes referred to as "third-level domains" – is related to the root domain and is denoted on the left as a second-level domain. In the URL "blog.rjsnetworkcloudacademy.com" the subdomain address would be "blog."

Trivia: The "WWW" in www.rjsnetworkcloudacademy.com is also a sub-domain, although it isn't always necessary to type it in a domain name.
Full Domain Subdomain Second-Level Domain Purpose
blog.rjsnetworkcloudacademy.com blog rjsnetworkcloudacademy Blog section
www.rjsnetworkcloudacademy.com www rjsnetworkcloudacademy Main website
mail.google.com mail google Email service
docs.google.com docs google Document service
shop.amazon.com shop amazon Shopping portal
Subdomain Benefits:
  • Organize different sections of a website
  • Host different services (blog, store, support)
  • Target different geographic regions (us.example.com, uk.example.com)
  • Separate development environments (dev.example.com, staging.example.com)
  • No limit to the number of subdomains you can create

8. Hosts

The host part of an FQDN is used to identify an individual device – usually a server. In the FQDN "myserver.example.com" the hostname would be "myserver."

FQDN Host Purpose
myserver.example.com myserver Generic server identification
webserver1.company.com webserver1 First web server
mailserver.domain.com mailserver Mail server
dbserver-prod.example.com dbserver-prod Production database server
Host Naming Conventions:
  • Use descriptive names that indicate the server's function
  • Include environment indicators (prod, dev, test)
  • Add numbers for multiple instances (web1, web2, web3)
  • Follow your organization's naming standards
  • Keep names concise but meaningful

9. Practice Exercises

Exercise 1: Identify DNS Hierarchy Components

For the FQDN: mail.support.amazon.co.uk.

Identify:

  • Root domain: . (dot)
  • Top-Level Domain: .co.uk
  • Second-Level Domain: amazon
  • Subdomain: support
  • Host: mail

Exercise 2: Create Valid Domain Names

Which of the following are valid domain names according to the LDH rule?

  • ✅ example-site.com (Valid)
  • ❌ -example.com (Invalid - starts with hyphen)
  • ✅ my-web-site123.net (Valid)
  • ❌ example_.com (Invalid - underscore not allowed)
  • ✅ 123example.org (Valid)
  • ❌ .123 (Invalid - TLD cannot be all numeric)

Exercise 3: DNS Resolution Order

For www.blog.company.com, DNS resolution proceeds in this order:

  1. Root DNS servers (.) – Direct to .com TLD servers
  2. TLD servers (.com) – Direct to company.com authoritative servers
  3. Authoritative servers (company.com) – Resolve blog.company.com
  4. Subdomain servers (blog.company.com) – Resolve www.blog.company.com

Exercise 4: Design Your DNS Hierarchy

Design a DNS hierarchy for a company called "TechCorp" with:

  • Main website
  • Blog section
  • Online store
  • Support portal
  • Development environment

Suggested Structure:

  • www.techcorp.com (main website)
  • blog.techcorp.com (blog)
  • shop.techcorp.com (online store)
  • support.techcorp.com (support portal)
  • dev.techcorp.com (development environment)
Key Takeaways:
  • DNS hierarchy is an inverted tree structure with five levels
  • Domain names are interpreted from right to left (Root → TLD → SLD → Subdomain → Host)
  • FQDN (Fully Qualified Domain Name) includes all components from root to host
  • 13 root servers (A-M) handle the top level of DNS resolution
  • TLDs can be organizational (.com, .org) or geographic (.uk, .ca)
  • Second-level domains represent your brand or organization
  • Subdomains organize different sections or services
  • Labels must follow LDH rule (Letters, Digits, Hyphen)
  • Maximum domain length is 255 characters including dots
📚 Additional Resources:

No comments:

Post a Comment