D 4: Making a DNS Server on Linux with Bind (15 pts.)

What You Need for This Project

Purpose

Make a DNS server with Bind on Linux.

Installing Bind

On your Linux machine, in a Terminal window, execute these commands, one at a time. Enter your password when you are prompted to.
sudo apt update
sudo apt install bind9 dnsutils bind9utils -y
sudo ss -plun
This starts bind9 with the default configuration, which makes it a recursive resolver, just like the Windows DNS server you made in a previous project.

You see the "named" process listening on port 53 on all available IP addresses, as shown below.

Testing the Resolver

In the Terminal window, execute this command:
dig @127.0.0.1 ccsf.edu
This sends a request to the localhost to find a DNS entry for "ccsf.edu".

As shown below, it finds an IPv4 address, and at the bottom, it shows the server that was used as "SERVER: 127.0.0.1#53(127.0.0.1)".

Flag D 4.1: TXT Record (10 pts)

In the Terminal window, execute this command:
dig @127.0.0.1 txt d4.samsclass.info
The flag appears, covered by a green rectangle in the image below.

Viewing the Server Cache

In the Terminal window, execute these commands:
sudo rndc dumpdb
nano /var/cache/bind/named_dump.db
If you can't find it, press Ctrl+W and type samsclass.info

Then press Enter.

You should the glue record for samsclass.info, as shown below.

Type Ctrl+X to exit nano.

Viewing DNS Delegation

In the Terminal window, execute this command:
dig @127.0.0.1 ccsf.edu +trace | grep from
You should see four servers used for each query, as shown below:

Flag D 4.2: SOA (5 pts)

In the Terminal window, execute this command:
dig @127.0.0.1 samsclass.info +trace | grep from
The flag appears, covered by a green rectangle in the image below.


Posted 6-1-23
Added more packages to "apt install" 6-24-23