The Basics of Computer Networks: DNS and IP Address
This is a multi-part series on DevOps 101. Access the complete DevOps series by clicking HERE
Access the The Basics of Computer Networks: Network Devices (Previous post in Networking) by clicking HERE
Access the The Basics of Computer Networks: Types of Network Architecture (Next Post in Networking) by clicking HERE
DNS (Domain Name System) refers to the hierarchical and decentralized naming system used to match domain names (like google.com) to their corresponding IP addresses. This system enables users to access different websites and services on the internet without having to remember the exact IP addresses of these sites. DNS servers, on the other hand, are responsible for managing and translating domain names to their corresponding IP addresses.
The Need of DNS
The Domain Name System was developed in the early 1980s by Paul Mockapetris, a computer scientist at the University of California, Los Angeles. The original purpose of the DNS was to make it easier for people to use the internet. Before the DNS, users had to remember the IP addresses of websites they wanted to visit. This was difficult and error-prone. With the DNS, users could simply type in a domain name, such as www.google.com, and the DNS would translate that into the IP address 172.217.14.192.
The DNS has evolved over time to meet the needs of the growing internet. In the early days of the internet, the DNS was a simple system. However, as the internet grew, the DNS became more complex. This is because the DNS had to be able to handle more requests and more data.
In recent years, the DNS has been updated to improve security. This is because the DNS has become a target for hackers. Hackers can try to steal data or disrupt DNS services. To improve security, the DNS has been updated to use features such as DNSSEC.
DNSSEC is a security protocol that can be used to verify the authenticity of DNS records. This can help to protect against DNS spoofing attacks. DNS spoofing is an attack where a hacker sends a fake DNS response to a user’s computer. This can cause the user’s computer to connect to the wrong website or service.
Here are some of the key events in the history of DNS:
- 1983: Paul Mockapetris publishes RFC 882, which describes the Domain Name System.
- 1985: The first DNS server is deployed.
- 1987: The first DNS root zone is created.
- 1995: The DNS is updated to support internationalized domain names.
- 2005: The DNS is updated to support DNSSEC.
- 2010: The DNS is updated to support IPv6.
Domain Names
A domain name is a unique identifier for a website or other online resource. It is used in place of a numeric IP address, which is a more difficult string of numbers to remember. Domain names are typically registered through a domain name registrar, such as GoDaddy or Namecheap.
Domain names are made up of two parts: a top-level domain (TLD) and a domain name. The TLD is the part of the domain name that comes after the last period. For example, in the domain name www.google.com
, the TLD is .com
. TLDs are managed by a variety of organizations, including the Internet Corporation for Assigned Names and Numbers (ICANN).
The domain name is the part of the domain name that comes before the TLD. For example, in the domain name www.google.com
, the domain name is google
. Domain names can be anything that is not already registered, as long as it follows the rules set by the TLD’s governing body.
Once a domain name is registered, it is associated with a specific IP address. This IP address is used by computers to locate the website or other online resource that is associated with the domain name.
Domain names are an important part of the internet. They make it possible for people to remember and access websites and other online resources without having to remember long strings of numbers (IP addresses).
Here are some of the benefits of using domain names:
- Easy to remember: Domain names are much easier to remember than IP addresses. This makes it easier for people to find and access websites and other online resources.
- Branding: Domain names can be used to create a strong brand identity for a business or organization.
- Scalability: Domain names can be scaled to meet the needs of a growing business or organization.
- Security: Domain names can be used to improve security by using features such as DNSSEC.
A top-level domain (TLD) is the part of a domain name that comes after the last dot. For example, in the domain name www.google.com
, the TLD is .com
. TLDs are managed by a variety of organizations, including the Internet Corporation for Assigned Names and Numbers (ICANN).
A second-level domain (SLD) is the part of a domain name that comes before the TLD. For example, in the domain name www.google.com
, the SLD is google
. SLDs can be anything that is not already registered, as long as it follows the rules set by the TLD’s governing body.
Here is a table that summarizes the key differences between TLDs and SLDs:
Feature | TLD | SLD |
---|---|---|
Location | After the last dot | Before the TLD |
Management | Managed by ICANN or a regional registry | Can be registered by anyone, subject to TLD rules |
Length | Varies, but typically 2-6 characters | Varies, but typically 3-12 characters |
Examples | .com, .org, .net | google, yahoo, mozilla |
TLDs and SLDs together make up a complete domain name. For example, the domain name www.google.com
is made up of the TLD .com
and the SLD google
.
TLDs are typically used to indicate the type of website or organization that a domain name belongs to. For example, the TLD .com
is typically used for commercial websites, while the TLD .org
is typically used for non-profit organizations.
SLDs can be used to create a unique and memorable identity for a website or organization. For example, the SLD google
is a unique and memorable name that helps to identify the Google website.
IP Addresses
An IP address, or Internet Protocol address, is a unique identifier assigned to every device that is connected to a computer network. IP addresses are used to route data between devices on the network.
Types of IP addresses
There are two main types of IP addresses: IPv4 and IPv6.
- IPv4 is the older version of IP addressing. It uses 32-bit addresses, which means that there are only about 4 billion possible IPv4 addresses.
- IPv6 is the newer version of IP addressing. It uses 128-bit addresses, which means that there are approximately 340 undecillion possible IPv6 addresses.
How IP addresses work
When you type a domain name into your web browser, your computer sends a request to a Domain Name System (DNS) server. The DNS server translates the domain name into an IP address. Your computer then uses the IP address to connect to the website.
IP address ranges
IP addresses are divided into ranges. Each range is assigned to a specific organization or group of users.
- Public IP addresses are assigned to devices that are connected to the public internet. They are routable on the internet, which means that they can be used to directly access websites or other resources on the internet. Public IP addresses are managed by the Internet Assigned Numbers Authority (IANA) and are allocated to organizations and ISPs.
There are three classes of public IP addresses:
- Class A public IP addresses have the first octet in the range of 1-126.
- Class B public IP addresses have the first two octets in the range of 128-191.
- Class C public IP addresses have the first three octets in the range of 192-254.
Class A public IP addresses can support up to 16,777,216 devices. Class B public IP addresses can support up to 65,536 devices. Class C public IP addresses can support up to 254 devices.
- Private IP addresses are assigned to devices that are connected to a private network, such as a home or office network. They are not routable on the public internet, which means that they cannot be used to directly access websites or other resources on the internet. Instead, private IP addresses are used to connect devices to a router, which then forwards traffic to the public internet using its own public IP address.
Here are the classes of private IP addresses:
- Class A private IP addresses range from 10.0.0.0 to 10.255.255.255.
- Class B private IP addresses range from 172.16.0.0 to 172.31.255.255.
- Class C private IP addresses range from 192.168.0.0 to 192.168.255.255.
IP address allocation
IP addresses are allocated by the Internet Assigned Numbers Authority (IANA). IANA is a non-profit organization that is responsible for coordinating the global Internet numbering resources.
Here are some additional things to know about IP addresses:
- IP address resolution: The process of converting a domain name into an IP address is called IP address resolution.
- IP address subnetting: IP address subnetting is the process of dividing a larger IP address range into smaller ranges. This can be used to improve network performance and security.
- IP address lease: When a device connects to a network, it is assigned an IP address lease. This lease is a temporary allocation of an IP address. When the lease expires, the device will be assigned a new IP address.
- IP address blacklisting: IP address blacklisting is the practice of blocking traffic from certain IP addresses. This can be used to prevent spam, malware, and other malicious activity.
How DNS Works
To understand how DNS works, you need to know the different types of DNS servers and how they interact with each other. DNS can be classified into four main server types: root servers, TLD servers, authoritative servers, and caching resolvers.
The process of querying a domain name starts with the user sending a request to the caching resolver. The resolver first queries the root servers to find the TLD (Top Level Domain) servers that are responsible for managing the domain name being searched. The TLD servers then refer the resolver to the authoritative servers that have the IP address for the domain name. The resolver then caches this IP address to speed up future domain name searches.
Let us understand the working of DNS by the following pictures:




Types of DNS Servers
- Root Servers – The root servers are the backbone of the DNS system. They store the IP addresses for all TLD servers and direct the resolver to the correct TLD server for a domain name search. Currently, there are 13 root servers distributed around the world.
- TLD Servers – Top-level domain (TLD) servers are responsible for managing domain names in their respective TLDs. They store the IP addresses for authoritative servers and direct the resolver to the correct authoritative server for a given domain name.
- Authoritative Servers – Authoritative servers are DNS servers that store the IP addresses for specific domain names. These servers are responsible for providing the correct IP address when a domain name is queried.
- Caching Resolvers – Caching resolvers are DNS servers that store the results of previous DNS queries in a cache to speed up future searches. They are the first point of contact between the user and the DNS system.
Domain Namespace

Domain name space is a hierarchical naming system for computers, services, or any resource connected to the internet. It is used to identify and locate websites and other online resources. The domain name space is divided into zones, which are managed by domain name registrars.
How Does Domain Name Space Work?
When you type a domain name into your web browser, it is first translated into an IP address. An IP address is a unique number that identifies a computer on the internet. The domain name system (DNS) is responsible for this translation.
The DNS is a distributed database that stores information about domain names and their corresponding IP addresses. When you type a domain name into your web browser, your computer sends a request to the DNS. The DNS then returns the IP address for the domain name. Your computer then uses the IP address to connect to the website.
The Structure of Domain Name Space
Domain name space is structured in a hierarchical fashion. The top-level domain (TLD) is the highest level in the hierarchy. TLDs are divided into two categories: generic TLDs (gTLDs) and country code TLDs (ccTLDs).
Generic TLDs are used for websites that are not specific to any particular country. Some common gTLDs include .com, .net, .org, .edu, and .gov.
Country code TLDs are used for websites that are specific to a particular country. Some common ccTLDs include .us, .uk, .ca, .au, and .jp.
Below the TLD is the second-level domain (SLD). The SLD is usually the name of the website or organization. For example, the SLD for the website www.google.com is google.
The SLD can be further divided into third-level domains (TLDs) and so on. Third-level domains are often used for subdomains, which are sub-sections of a website. For example, the subdomain blog.google.com is a subdomain of the website www.google.com.
Name Servers
Name servers are a critical part of the internet infrastructure. They are responsible for translating domain names into IP addresses. This allows users to access websites by typing in their domain name, rather than their IP address.
How Name Servers Work
When you type a domain name into your web browser, your computer sends a request to a name server. The name server then looks up the domain name in its database and returns the corresponding IP address. Your computer then uses the IP address to connect to the website.
Types of Name Servers
There are two main types of name servers:
- Root name servers: Root name servers are the top-level of the domain name system (DNS). They are responsible for storing information about the top-level domains (TLDs).
- Top-level domain name servers: Top-level domain name servers are responsible for storing information about the second-level domains (SLDs) within a TLD.
Name Server Records
Name servers use records to store information about domain names and their corresponding IP addresses. There are several different types of name server records, including:
- A records: A records are used to store the IP addresses of websites.
- CNAME records: CNAME records are used to store the canonical names of websites. A canonical name is a domain name that is used to point to another domain name.
- MX records: MX records are used to store the mail exchange servers for websites.
- NS records: NS records are used to store the name servers for websites.
DNS Resolvers
A DNS resolver, also known as a recursive resolver, is a server that converts domain names into IP addresses. When you type a domain name into your web browser, your computer sends a request to a DNS resolver. The DNS resolver then returns the IP address for the domain name. Your computer then uses the IP address to connect to the website.
How does a DNS resolver work?
When a user types a domain name into a web browser, the browser sends a request to a DNS resolver. The DNS resolver then contacts a series of other DNS servers to find the IP address for the domain name. Once the DNS resolver has found the IP address, it returns it to the web browser. The web browser then uses the IP address to connect to the website.
Types of DNS resolvers
There are two main types of DNS resolvers:
- Recursive resolvers: Recursive resolvers are used by end-users, such as home users and businesses. They are responsible for resolving domain names to IP addresses.
- Authoritative resolvers: Authoritative resolvers are used by domain name registrars and other organizations that manage domain names. They are responsible for storing information about domain names and their corresponding IP addresses.
DNS Records
DNS records are a type of data stored in the Domain Name System (DNS). DNS records store information about domain names and their corresponding IP addresses. This information is used by computers to find and connect to websites.
Types of DNS records
There are many different types of DNS records, each with a different purpose. The most common types of DNS records include:
- A records: A records store the IP addresses of websites.
- CNAME records: CNAME records store the canonical names of websites. A canonical name is a domain name that is used to point to another domain name.
- MX records: MX records store the mail exchange servers for websites. Mail exchange servers are responsible for receiving and delivering email for a domain name.
- NS records: NS records store the name servers for websites. Name servers are responsible for resolving domain names to IP addresses.
- TXT records: TXT records store text data for websites. TXT records can be used for a variety of purposes, such as adding security features to a website or adding information about a website to search engines.
DNS Cache and TTL
What is DNS cache?
DNS cache is a temporary storage area on a computer or network device that stores DNS records. When a user requests a website, the DNS resolver first checks the DNS cache to see if the record is already stored. If the record is in the cache, the DNS resolver returns the record to the user. If the record is not in the cache, the DNS resolver will query the authoritative DNS server for the record.
What is TTL?
TTL stands for Time To Live. TTL is a value that is associated with a DNS record. TTL specifies how long the DNS record can be stored in the DNS cache. After the TTL expires, the DNS record is removed from the cache.
How does DNS cache and TTL work together?
DNS cache and TTL work together to improve the performance of DNS queries. When a user requests a website, the DNS resolver first checks the DNS cache to see if the record is already stored. If the record is in the cache, the DNS resolver returns the record to the user. This saves time because the DNS resolver does not have to query the authoritative DNS server for the record.
If the record is not in the cache, the DNS resolver will query the authoritative DNS server for the record. The authoritative DNS server will return the record to the DNS resolver. The DNS resolver will then store the record in the DNS cache. The next time a user requests the website, the DNS resolver will return the record from the DNS cache.
Benefits of DNS cache and TTL
There are several benefits to using DNS cache and TTL. These benefits include:
- Improved performance: DNS cache and TTL can improve the performance of DNS queries by reducing the number of times that the DNS resolver has to query the authoritative DNS server.
- Reduced load on DNS servers: DNS cache and TTL can reduce the load on DNS servers by reducing the number of requests that they have to process.
- Improved security: DNS cache and TTL can improve the security of DNS queries by preventing attackers from spoofing DNS records.
Key Takeaways
- DNS is a decentralized and hierarchical system that matches domain names to IP addresses.
- DNS servers manage and translate domain names to IP addresses, making it easier for users to access websites and online services.
- DNS has evolved over time to meet the needs of the internet and has been updated for security purposes.
- Domain names are an essential part of the internet and are made up of a top-level domain (TLD) and a domain name.
- DNS uses different types of servers to work, including root servers, TLD servers, authoritative servers, and caching resolvers.
- Domain name space is structured in a hierarchical fashion and is divided into zones managed by domain name registrars.
- Name servers are responsible for translating domain names into IP addresses.
- DNS records store information about domain names and their corresponding IP addresses, and there are many types of DNS records, including A records, CNAME records, and MX records.
- DNS cache is a temporary storage area that saves DNS records, while TTL is a value associated with a DNS record that determines how long the record can be stored in the cache.
- The benefits of DNS cache and TTL include faster performance and reduced network traffic
More great stuff related to networking coming soon! Stay tuned and share and subscribe for more!
Access the The Basics of Computer Networks: Types of Network Architecture (Next Post in Networking) by clicking HERE
Access the The Basics of Computer Networks: Network Devices (Previous post in Networking) by clicking HERE
This is a multi-part series on DevOps 101. Access the complete DevOps series by clicking HERE