0% found this document useful (0 votes)
49 views

Domain Name Server (DNS)

The document discusses DNS (Domain Name System) configuration on Ubuntu 20.04. It provides instructions on installing and configuring the BIND DNS server software. It explains key DNS concepts like DNS resolution and the different DNS server types involved. It also shows how to create DNS zone files, test the DNS configuration, and set the local system to use the BIND server as its primary DNS.

Uploaded by

INFO TEC
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
49 views

Domain Name Server (DNS)

The document discusses DNS (Domain Name System) configuration on Ubuntu 20.04. It provides instructions on installing and configuring the BIND DNS server software. It explains key DNS concepts like DNS resolution and the different DNS server types involved. It also shows how to create DNS zone files, test the DNS configuration, and set the local system to use the BIND server as its primary DNS.

Uploaded by

INFO TEC
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 39

DOMAIN NAME

SERVER (DNS)
DNS CONFIGURATION
WHAT IS DNS
• The Domain Name System (DNS) is the phonebook of the Internet. Humans
access information online through domain names, like nytimes.com or espn.com.
Web browsers interact through Internet Protocol (IP) addresses. DNS translates
domain names to IP addresses so browsers can load Internet resources.
• Each device connected to the Internet has a unique IP address which other
machines use to find the device. DNS servers eliminate the need for humans to
memorize IP addresses such as 192.168.1.1 (in IPv4), or more complex newer
alphanumeric IP addresses such as 2400:cb00:2048:1::c629:d7a2 (in IPv6).
How does DNS work?

• The process of DNS resolution involves converting a hostname (such as www.example.com)


into a computer-friendly IP address (such as 192.168.1.1). An IP address is given to each
device on the Internet, and that address is necessary to find the appropriate Internet device -
like a street address is used to find a particular home. When a user wants to load a webpage,
a translation must occur between what a user types into their web browser (example.com)
and the machine-friendly address necessary to locate the example.com webpage.
• In order to understand the process behind the DNS resolution, it’s important to learn about
the different hardware components a DNS query must pass between. For the web browser,
the DNS lookup occurs "behind the scenes" and requires no interaction from the user’s
computer apart from the initial request.
NO DNS FOUND
How does DNS work?
Checking
There are 4 DNS servers involved in loading a webpage

• DNS recursor - The recursor can be thought of as a librarian who is asked to go find a particular book
somewhere in a library. The DNS recursor is a server designed to receive queries from client machines
through applications such as web browsers. Typically the recursor is then responsible for making additional
requests in order to satisfy the client’s DNS query.
• Root nameserver - The root server is the first step in translating (resolving) human readable host names
into IP addresses. It can be thought of like an index in a library that points to different racks of books -
typically it serves as a reference to other more specific locations.
• TLD nameserver - The top level domain server (TLD) can be thought of as a specific rack of books in a
library. This nameserver is the next step in the search for a specific IP address, and it hosts the last portion
of a hostname (In example.com, the TLD server is “com”).
• Authoritative nameserver - This final nameserver can be thought of as a dictionary on a rack of books, in
which a specific name can be translated into its definition. The authoritative nameserver is the last stop in
the nameserver query. If the authoritative name server has access to the requested record, it will return the
IP address for the requested hostname back to the DNS Recursor (the librarian) that made the initial request.
STEPS IN A DNS LOOKUP:
• A user types ‘example.com’ into a web browser and the query travels into the Internet and is received by a DNS recursive
resolver.
• The resolver then queries a DNS root nameserver (.).
• The root server then responds to the resolver with the address of a Top Level Domain (TLD) DNS server (such as .com or .net),
which stores the information for its domains. When searching for example.com, our request is pointed toward the .com TLD.
• The resolver then makes a request to the .com TLD.
• The TLD server then responds with the IP address of the domain’s nameserver, example.com.
• Lastly, the recursive resolver sends a query to the domain’s nameserver.
• The IP address for example.com is then returned to the resolver from the nameserver.
• The DNS resolver then responds to the web browser with the IP address of the domain requested initially.
• Once the 8 steps of the DNS lookup have returned the IP address for example.com, the browser is able to make the request for
the web page:
• The browser makes a HTTP request to the IP address.
• The server at that IP returns the webpage to be rendered in the browser (step 10).
CONFIGURATION STEPS OF DNS ON
UBUNTU 20.04
• How to Install and configure DNS on Ubuntu 20.04.
• A DNS server is a system server that check a database of Ip address and
clients.  It provides to resolve those names to public ip address as
requested. DNS servers run software and communicate with each other
using protocols.
• Domain Name Service (DNS) is an Internet service that contains IP
addresses and fully qualified domain names (FQDN) to other. Computers
that run DNS are called name server
Installing BIND on Ubuntu 18.04 LTS:

Update ubuntu
Installing BIND on Ubuntu 18.04 LTS:
Installing BIND on Ubuntu 18.04 LTS:

Install bind9
Installing BIND on Ubuntu 18.04 LTS:
Installing BIND on Ubuntu 18.04 LTS:
Installing BIND on Ubuntu 18.04 LTS:

BIND 9 is installed.
Configuring BIND 9:

• All the configuration files of BIND 9 is in /etc/bind and /var/cache/bind directory.


• The main configuration files are named.conf, named.conf.default-
zones, named.conf.local, and named.conf.options as marked in the screenshot below.
Configuring BIND 9:

• You also create many zone files in /var/cache/bind directory. A zone


file holds information about a certain domain name and its subdomains.
It’s a simple text file.
• For example, the information about domain/zone example.com would be
stored in plain text format in a zone file such
as db.example.com in /var/cache/bind directory.
Configuring BIND 9:

• Now I am going to create a simple zone file


for example.com and show you how to set up your
own DNS names with BIND 9.
• First, navigate to the /var/cache/bind directory with
the following command:
Configuring BIND 9:
Configuring BIND 9:
Configuring BIND 9:

Now, create a new file db.example.com and open it with nano text editor (if


you want to follow along) with the following command:
Configuring BIND 9:
Configuring BIND 9:

• Now run the following command to check whether you’ve made any
mistakes in the zone file:
Configuring BIND 9:

• Now you have to tell bind to load the data file db.example.com for the
zone example.com.
• To do that, open /etc/bind/named.conf.local file with the following
command:
Configuring BIND 9:

• Now restart BIND 9 service with the following command:


Configuring BIND 9:

Testing BIND 9 Configuration with dig:


dig is used to make request to the DNS server and show the DNS records of any DNS zone.
For example, to list all the records of example.com zone we’ve created earlier, run the following
command:
$ dig @192.168.11.51 example.com any

NOTE: Here, @192.168.11.51 is used to tell dig to use the nameserver 192.168.11.51. This is the IP
address of my computer where BIND 9 is running. If you don’t know the IP address of your computer,
run ip addr command to see the IP address of your computer.
Configuring BIND 9:

As you can see in the marked section of the screenshot below, BIND 9 can resolve example.com domain
name to IP addresses correctly.
Configuring BIND 9:

As you can see, I can also resolve www.example.com using my own DNS server.


setting Primary DNS Server on
Ubuntu
Ubuntu 18.04 LTS uses systemd-resolve to resolve DNS hostnames. It also caches DNS results. In this
section, I will show you how to set your own DNS server as the primary DNS server on Ubuntu 18.04
LTS using systemd-resolve.

First, open the configuration file for systemd-resolve with the following command:
setting Primary DNS Server on
Ubuntu
• Now, replace #DNS= with DNS=IP_ADDR as shown in the marked
section of the screenshot below. Here, IP_ADDR is the IP address of your
BIND 9 server
• .
setting Primary DNS Server on
Ubuntu
• Now save the file and restart your computer with the following command:
setting Primary DNS Server on
Ubuntu
• Once your computer start’s, run the following command to check your
primary DNS server:
setting Primary DNS Server on
Ubuntu
• As you can see, the primary DNS server is set to 192.168.11.51, the one
that I set earlier.
setting Primary DNS Server on
Ubuntu
• Now I can run dig without saying what DNS server to use and still be able
to resolve example.com as you can see in the screenshot below
setting Primary DNS Server on
Ubuntu
• As you can see, I can also ping www.example.com.
Understanding Zone File Format
• Now that your DNS server is working, it’s time to learn more about the
BIND 9 zone file.
• The zone file db.example.com defines how a domain name is resolved
and what IP it is resolved to, mail servers of a domain, nameservers of a
domain and many more information.
• In our earlier zone file for example.com, $ORIGIN defines a value for
the @ symbol. Wherever you out @, it will be replaced by the value in
the $ORIGIN, which is example.com.
Understanding Zone File Format
• NOTE: Don’t forget the dot(.) after example.com as it is required for the
domain to be FQDN (Fully Qualified Domain Name) and without it,
BIND won’t work.
Understanding Zone File Format
Understanding Zone File Format
• If you don’t put a FQDN in BIND zone file, then the value
of $ORIGIN will be appended to the name. For example, ns1 is not a
FQDN. So ns1 will be ns1.example.com. ($ORIGIN appended at the
end).

You might also like