CNIT 40 Proj 2: 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.

Start Your Host Machine

If you are working in S214, select a machine to be your primary machine for the semester. You'll want to keep using the same machine as much as possible, because your virtual machines will be there. Power on your computer. Boot to the operating system named "Win 7-S214". Log on as Student with no password.

Making Your VM (Virtual Machines) Folder

Click Start, Computer. Find the "VMs-S214" drive and double-click it to open it.

In the VMs-S214 window, right-click the empty space and click New, Folder. Name the folder "YOUR NAME VMs" replacing YOUR NAME with your own name.

Extracting the Kali Virtual Machine

  1. Download the Kali virtual machine from this link:

    https://www.offensive-security.com/kali-linux-vmware-arm-image-download/

  2. You need 7-Zip on your host machine. If you don't have it, you download it from 7-zip.org. If you are using a Mac, go to the App Store and get "The Unarchiver".

  3. Make a folder for your Kali virtual machine on the VMs-S214 partition or some other available partition. I recommend making a folder with your name on it, and a subfolder within it named Kali.

    DO NOT PUT VIRTUAL MACHINES ON THE C: DRIVE IN S214. They fill the drive and make the machine unusable, and will be deleted.

  4. Right-click the Kali .7z file, click 7-Zip, and click "Extract Files...". In the "Extract to:" box, enter the path to the folder you prepared, such as "G:\YOURNAME\Kali". Click OK.

Starting the Kali Linux Machine and Adjusting Networking

Start the Kali Linux machine in VMware Player.

If you don't see a user named "root", click Other....

Log in to Kali with the username root and a password of toor

You should see the Kali Linux desktop as shown below:

Setting the Kali Linux VM to Bridged or NAT Networking

In the VMware Player window showing your Kali Linux desktop, on the top left, click Player, Manage, "Virtual Machine Settings".

In the "Virtual Machine Settings" box, on the left side, click "Network Adapter".

On the right side, click "Bridged: Connect directly to the physical network" or "NAT". Click OK.

At the top left of the Kali Linux desktop, find these items:

At the top left of the Kali Linux desktop, click the rectangular black icon to open a Terminal window.

In the Terminal window, type in this command to get a new IP address, and then press the Enter key:

dhclient -v

Finding your Kali Linux VM's IP Address

In the Terminal window, execute this command:
ifconfig
You should see your IP address, as shown below:

Testing the Internet Connection

In the Terminal window, execute this command:
ping google.com
You should see replies, starting with "64 bytes from ...", as shown below.

If you don't get replies, you need to fix your networking before proceeding.

Try restarting the Kali machine.

Installing Bind

In the Terminal window, execute these commands:
apt-get update

apt-get install bind9 -y

service bind9 start

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.

Troubleshooting

If your Kali gives errors when updating, and bind doesn't install correctly, you may need to edit /etc/apt/sources.list as explained here:

http://docs.kali.org/general-use/kali-linux-sources-list-repositories

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 the address 147.144.1.212, and at the bottom, it shows the server that was used as "SERVER: 127.0.0.1#53(127.0.0.1)".

Saving a Screen Image

Click the taskbar at the bottom of your host Windows 7 desktop, to make the host machine listen to the keyboard, instead of the virtual machine.

Make sure the terminal window on Kali is visible showing these items:

Press the PrintScrn key in the upper-right portion of the keyboard. That will copy the whole desktop to the clipboard.

YOU MUST SUBMIT A FULL-DESKTOP IMAGE FOR FULL CREDIT!

Paste the image into Paint and save it with the filename "YOUR NAME Proj 2a", replacing "YOUR NAME" with your real name.

No Client Cache

Kali Linux does not cache DNS entries by default at the client level the way Windows does. So there's no client cache to observe.

Viewing the Server Cache

In the Terminal window, execute these commands:
rndc dumpdb

nano /var/cache/bind/named_dump.db

Scroll through the file and find ccsf.edu, as shown below.

If you can't find it, press Ctrl+W to search for ccsf.edu

You should see ccsf.edu followed several lines later by 147.144.1.212

Saving a Screen Image

Click the taskbar at the bottom of your host Windows 7 desktop, to make the host machine listen to the keyboard, instead of the virtual machine.

Make sure the terminal window on Kali is visible showing these items:

Press the PrintScrn key in the upper-right portion of the keyboard. That will copy the whole desktop to the clipboard.

YOU MUST SUBMIT A FULL-DESKTOP IMAGE FOR FULL CREDIT!

Paste the image into Paint and save it with the filename "YOUR NAME Proj 2b", replacing "YOUR NAME" with your real name.

Exiting Nano

In the Nano window, press Ctrl+X to exit.

Viewing DNS Delegation

In the Terminal window, execute this command:
dig @127.0.0.1 ccsf.edu +trace
You should see four sections, as shown below:

Saving a Screen Image

Click the taskbar at the bottom of your host Windows 7 desktop, to make the host machine listen to the keyboard, instead of the virtual machine.

Make sure the terminal window on Kali is visible showing the four items listed above.

If your screen resolution is small, you may need to capture two images to get it all.

Press the PrintScrn key in the upper-right portion of the keyboard. That will copy the whole desktop to the clipboard.

YOU MUST SUBMIT A FULL-DESKTOP IMAGE FOR FULL CREDIT!

Paste the image into Paint and save it with the filename "YOUR NAME Proj 2c", replacing "YOUR NAME" with your real name.

Turning In Your Project

Email the images to me as an attachments to an e-mail message. Send it to: cnit.40@gmail.com with a subject line of "Proj 2 From YOUR NAME", replacing "YOUR NAME" with your real name.

Send a Cc to yourself.


Last modified 9-13-16