Install and Configure a Linux DNS Server

This IT Pro Challenge virtual lab shows learners how to configure a Linux Ubuntu Domain Name System (DNS) server by installing Berkeley Internet Naming Daemon 9 (bind9), create forward and reverse lookup zones, as well as NS and A records in the zone file for each server, and configure Internet Fully Qualified Domain Names (FQDNs).

1 hour
Join over 3 million cybersecurity professionals advancing their career
Sign up with
Required fields are marked with an *

Already have an account? Sign In »


In this IT Pro Challenge virtual lab, learners will understand how to install a Domain Name System (DNS) server on an Ubuntu Linux machine by using the Berkeley Internet Naming Daemon (bind9) and bind utils, create forward and reverse lookup zone files with both NS and A records for two Ubuntu servers, and configure Internet Fully Qualified Domain Names (FQDNs). As a result, learners will become comfortable using the sudo command and will acquire the skills required for a job as a Linux network or system administrator.


The scenario for this virtual lab is that you are the Linux administrator, and you need to configure a Linux Domain Name System (DNS) server that supports name resolution for both internal hosts and Internet Fully Qualified Domain Names (FQDNs). An FQDN is the complete domain name for a host comprising of two parts: hostname and domain name.

You will have access to two Ubuntu Linux virtual machines (Ubuntu1, Ubuntu2). You will install and configure a DNS server on Ubuntu1 that also has internet access. Then, you will configure Ubuntu2 to use Ubuntu1 as a DNS server.

Ubuntu Server is an open-source server operating system that is compatible with almost any hardware. It does not require the use of anti-virus software, making the risk of malware negligible.

DNS works by resolving domain names (Example: into IP addresses. DNS defines the domain namespace. There are levels of domains: top (“.com”), second-level (“”), and lower-level or subdomains (“”).

Install a DNS server on Ubuntu1

To begin the lab, you first need to install the bind9 and bind9utils packages on the Ubuntu1 virtual machine. Run the sudo apt-get install bind9 bind9utils bind9-doc command to install bind9. Then, you will use the sudo command to start the bind9 service and the netstat -a command to verify that the DNS server is in the LISTEN state on UDP port 53.

Berkeley Internet Naming Daemon (BIND) is an open-source DNS server, and bind9 (released in 2000) is the most widely used version.

Configure the bind9 DNS server on Ubuntu1

Now you are going to enable DNS to forward an IP address of on Ubuntu1 so that queries for the Internet FQDNs are resolved. Then you will restart the DNS server daemon, make sure the bind9 daemon is running, and that the IP address of is listed as a forwarder in /etc/bind/named.conf.options?.

Create a forward lookup DNS zone on Ubuntu1

Next, you will create a forward lookup DNS zone (, and you will add an NS record for Ubuntu1, and an A record for Ubuntu1 and Ubuntu2. As a proof of concept, you will verify that the /etc/bind/zones/ file exists, that NS and A records are defined in the zone file for Ubuntu1, and that there is an A record for Ubuntu2.

Create a reverse lookup DNS zone on Ubuntu1

You will use the ifconfig command to view the IP address and netmask, giving you the IP network. You will create a reverse DNS zone with the naming convention:, where z.y.x = the IP address backwards. For example, if the IP network is, the reverse zone is

Then you will then add a Pointer Record (PTR) for both servers (Ubuntu1, Ubuntu2). PTR records are defined in the /etc/bind/zones/ A PTR is a type of DNS record that resolves an IP address to a domain/host name. PTRs are slightly different from A records because A records point a domain name to an IP address. PTR records are used for reverse DNS lookups; there should be one A record for each PTR.

Configure Internet FQDN name resolution on Ubuntu2

Finally, on the Ubuntu2 virtual machine, you will configure the netplan config YAML file to point to the Ubuntu1 DNS server IP address.

Summary Conclusion

By taking this virtual lab, you will learn how to install the bind9 DNS server, configure a DNS forwarder, a DNS forward/reverse lookup zone, and DNS client name resolution.