Lab 8: DNS, Virtual Hosting and Sendmail

Stephen Jones < sjones@cs.ucr.edu>

Objective

The goal of this tutorial is to set up your own DNS server for your own domain name and then proceed to setup an email server for the domain.

Introduction

The DNS server will translate names to IP addresses and vise versa. Making your own DNS server will allow you to translate these things accoding to your own goals.

Procedures

DNS
Install the DNS server on both the Router VM and Host VM (Edit your file to mirror the image when given a $ vi command: The following steps will allow you to configure the Router VM to be a master DNS server: To setup the Host VM to be a slave DNS server, follow the same steps as the Router VM setup with the exception of editing the /etc/named.conf file: Give /var/run/named write permissions: Run named on both the Router VM and Host VM: Resolve the following names, on both the Router VM and Host VM, to check if you've done correctly so far: "ns.linux.is.better", "ns2.linux.is.better", "fw.linux.is.better", "www.linux.is.better": For insurance, run the following commands on the Host VM: As an added bonus, run this command on the Host VM: Make named run over reboot on both the Router VM and Host VM:
Virtual Hosting
Check to see if you can access your new domain linux.is.better using telnet:
Sendmail
Configure sendmail in the Router VM to spool emails for linux.is.better domain: Restart sendmail: Now send an email to root@linux.is.better from the Host VM: On the Router VM, check the file /var/mail/root:

Conclusion

You now have set up your own DNS server where you interpret domain names into the IP addresses of your choosing. Complete with mail capabilities Congratulations!

Further Reading

A DNS setup tutorial for Windows server 2003 Curious how a DNS server works?

Glossary

DNS server
"The Domain Name System (DNS) associates various information with domain names; most importantly, it serves as the "phone book" for the Internet by translating human-readable computer hostnames, e.g. www.example.com, into IP addresses, e.g. 208.77.188.166, which networking equipment needs to deliver information. It also stores other information such as the list of mail servers that accept email for a given domain. In providing a worldwide keyword-based redirection service, the Domain Name System is an essential component of contemporary Internet use." (source: www.wikipedia.org)

nameserver
"In computing, a name server (also called 'nameserver') consists of a program or computer server that implements a name-service protocol. It will normally map (i.e. connect) a human-recognisable identifier of a host (for example, the domain name 'en.wikipedia.org') to its computer-recognisable identifier (such as the Internet Protocol (IP) address 145.97.39.155), and vice versa." (source: www.wikipedia.org)

domain name
"The term domain name has multiple related meanings:
    * A name that identifies a computer or computers on the Internet. These 
      names appear as a component of a Web site's URL, e.g. en.wikipedia.org. 
      This type of domain name is also called a hostname.

    * The product that domain name registrars provide to their customers. These
      names are often called registered domain names.

    * Names used for other purposes in the Domain Name System (DNS), for 
      example the special name which follows the @ sign in an email address, or
      the Top-level domain names like .com, or the names used by the Session 
      Initiation Protocol (VoIP), or DomainKeys.

    * They are sometimes colloquially (and incorrectly) referred to by 
      marketers as "web addresses". "
(source: www.wikipedia.org)

Questions

  1. Show the result of
    $ host ns2.linux.is.better 10.0.0.1
    $ host ns2.linux.is.better 10.0.0.2
    $ host ftp.linux.is.better 10.0.0.2
    
    from the DNS installation section.


  2. Show that named is running on both ns and ns2 over reboot.


  3. Show the result of requesting a page from www.linux.is.better via the Host VM.

  4. Show the received email including the email headers to your_account@linux.is.b