DNS (Domain Name System) Overview
DNS (Domain Name System) Overview
DNS (Domain Name System) Overview
Components of DNS:
1. DNS Server:
A DNS server is a computer or network device that stores the DNS database and responds to
DNS queries from clients. It can be authoritative, caching, or a combination of both.
2. DNS Resolver:
The resolver is a component on a client system or network that initiates DNS queries. It sends
queries to DNS servers to obtain the IP address corresponding to a given domain name.
3. Zone:
A zone is a portion of the DNS namespace that is managed by a specific DNS server or
authority. Zones are defined by domain boundaries. 4.
4. Resource Records (RRs):
Resource records are the fundamental building blocks of the DNS database. They contain
information about domain names, IP addresses, mail servers, and other DNS-related
information.
3. Query Resolution:
The resolver first checks its local cache to see if it has the IP address for the given domain. If
not, it sends a query to the root DNS server.
4. Iterative Process:
The root DNS server responds with a referral to the top-level domain (TLD) DNS server
responsible for the domain extension (e.g., .com).
The TLD DNS server responds with a referral to the authoritative DNS server for the specific
domain (e.g., example.com).
The authoritative DNS server provides the IP address associated with the requested domain.
5. Response to User:
The resolver caches the obtained IP address and returns it to the user's system.
2. Configuration:
a. Basic Configuration File (/etc/bind/named.conf):
This file includes configurations for various aspects of Bind9. It often includes references to
other configuration files.
• A forwarders directive that defines what DNS servers this server will forward recursive
queries to.
To make those changes, open /etc/bind/named.conf.options in a text editor (e.g., nano ) and
modify the files to look similar to this:
options {
directory "/var/cache/bind";
forwarders {
8.8.8.8;
8.8.4.4; };
dnssec-validation auto;
listen-on-v6 { any; };
};
Next, we'll create a directory to store the zone files we specified in the previous step.
$mkdir /etc/bind/zones/
Now, we'll create a corresponding zone file /etc/bind/zones/db.direct. The forward zone file allows
the Bind DNS server to resolve names (like vbox.tpdns.net) to IP addresses (like 192.168.1.20).
Open /etc/bind/zones/db.direct in a text editor (e.g., nano ) and make the changes indicated in the
comments below:
$TTL 604800
@ IN SOA vbox.tpdns.net root.tpdns.net. (
2 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ) ; Negative Cache TTL
;
@ IN NS vbox.tpdns.net.
vbox IN A 192.168.1.20
@ IN AAAA ::1
• Reverse zone file
Now that the zone is setup and resolving names to IP Addresses, a Reverse zone needs to be added
to allows DNS to resolve an address to a name.
zone "1.168.192.in-addr.arpa" {
type master;
file "/etc/bind/zones/db.inverse";
};
Open /etc/bind/zones/ db.inverse in a text editor (e.g., nano) and make the changes indicated in the
comments below:
$TTL 604800
@ IN SOA vbox.tpdns.net root.tpdns.net. (
1 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800) ; Negative Cache TTL
;
@ IN NS vbox.tpdns.net.
20 IN PTR vbox.tpdns.net.
2. Starting and Managing DNS:
For each DNS name server you plan on using, add a line to the file. The nameserver with the IP
address should be the first thing on the line:
nameserver 192.168.1.20
options edns0 trust-ad
search tpdns.net
domain tpdns.net
Use tools like nslookup, dig, or host to test DNS resolution and query responses.
• Nslookup vbox.tpdns.net
Server: 192.168.1.20
Address: 192.168.1.20#53
Name: vbox.tpdns.net
Address: 192.168.1.20
• Nslookup 192.168.1.20
Conclusion:
DNS is a critical component of internet infrastructure, facilitating the translation of human-
readable domain names into IP addresses. Installing and configuring DNS on a Linux Ubuntu
system involves setting up a DNS server, defining zones, configuring zone files, and managing
global options. Proper configuration ensures efficient and accurate DNS resolution, contributing
to the overall functionality and accessibility of the internet.