Chapter 3. Domain Name System

Table of Contents

Introduction to DNS Configuration
Purchase Domain Name Through the Registrar
Configure Name Servers at the Registrar
Configure DNS for Rackspace Machine
Name Server Entries
Verify DNS with `ping` & `dig`
DNS Check Point

Introduction to DNS Configuration

In this chapter we'll configure our virtual machine to work with DNS (Domain Name System). The essence of DNS is to map a human-readable name to an IP address. In particular, we want a name of our choice to be mapped to the IP address of the machine that we launched previously. DNS can be a complicated arrangement to set up in some cases, but we'll stick with the basics. To understand more about how DNS works, you can reference the tutorial How DNS Works by Tech Republic and/or How DNS Works by HowStuffWorks . The steps we'll follow are listed here for clarity:

  1. Purchase domain name at an accredited registrar.
  2. Configure the name servers for that domain name.
  3. Configure the DNS zone via RackSpace to hold the entry for our machine.
  4. Create the appropriate entry for our machine.
  5. Verify our configuration.

Purchase Domain Name Through the Registrar

Domain names are controlled and sold through an accredited registrar. This makes it possible for the "name to IP address" configuration to propagate throughout the entire world. There are many registrars available. Listed below are three of the most popular.

There are so many registrars and different interfaces it is beyond the scope of this class to guide you through the purchase of a domain name. If you have trouble, call the registrar on the phone or contact their support desk and have them guide you through the process. Most likely, you'll have to create an account with the registrar to purchase the domain name. While you're logged in to that interface, during the purchase process, configure the name servers for the name as shown below.

Configure Name Servers at the Registrar

When you purchase the domain name through the registrar, there will be a configuration setting for the name servers that will hold the crucial IP address information for the domain name. Each interface will be different, depending on where the name is purchased. However, it will be somewhat similar to the configuration that is shown below.

Figure 3.1. Nameserver Configuration

Nameserver Configuration

This configuration must be in place or the name will not resolve to the correct IP address. The RackSpace DNS servers are shown in the image above. Enter those names into the configuration for your domain name at the registrar where you purchased the domain name. Don't go any further until you have the nameserver information entered correctly at the name registrar.

Configure DNS for Rackspace Machine

Once the configuration is in place at the name registrar, we can continue to configure the DNS zone in the RackSpace interface. The steps below, with screen shots, outline the process.

Figure 3.2. Configure Rackspace DNS #1

Configure Rackspace DNS #1

  1. Click on DNS.
  2. Click on Create Domain.
  3. Enter your domain name and contact email address; leave TTL at 5 minutes.
  4. Click on create domain

Figure 3.3. Configure Rackspace DNS #2

Configure Rackspace DNS #2

  1. Note the two NS entries that are automatically populated, leave them alone.
  2. Click on Add Record.
  3. Leave record type to A/AAAA.
  4. Enter 'alpha' into Hostname.
  5. Enter the public IP that you noted earlier.
  6. Leave TTL at 5 minutes.
  7. Click Add Record.

Figure 3.4. Configure Rackspace DNS #3

Configure Rackspace DNS #3

  1. Again, click on Add Record.
  2. Set type to CNAME.
  3. In hostname, type 'www'.
  4. In Target (Domain), type 'alpha.domain name'.
  5. Leave TTL at 5 minutes.
  6. Click on Add Record.

Name Server Entries

After making the above changes, it's time to look at the list of DNS entries.

Figure 3.5. List of DNS Entries

List of DNS Entries

Your DNS records should look like the screenshot above. Now it's time to configure a reverse DNS entry for your server. Reverse DNS verifies that the IP address is connected to the domain name. Reverse DNS entries are useful for many reasons, one of them being proper mail delivery.

Figure 3.6. Configure Reverse DNS #1

Configure Reverse DNS #1

  1. In the RackSpace interface, next to "Reverse DNS", click on Add Record.

Figure 3.7. Configure Reverse DNS #2

Configure Reverse DNS #2

  1. When the dialog box opens, enter the fully qualified domain name (FQDN) of your machine into the field as shown.
  2. Click on "Save Record".

That should complete our DNS configuration. In the next section we'll verify what we've done.

Verify DNS with `ping` & `dig`

Now it's time to verify that DNS is working.

  1. You should be able to successfully ping your new machine by ip name: `ping -c 4 alpha.'domain-name'`.
  2. You should be able to successfully ping your new machine by the www cname: `ping -c 4 www.'domain-name'`.
  3. See below for successful details.
    17:49:15
    bob@intrepid ~/
    --> ping -c 4 alpha.blue-meltdown.net
    PING alpha.blue-meltdown.net (50.56.249.136) 56(84) bytes of data.
    64 bytes from alpha.blue-meltdown.net (50.56.249.136): icmp_seq=1 ttl=52 time=35.2 ms
    64 bytes from alpha.blue-meltdown.net (50.56.249.136): icmp_seq=2 ttl=51 time=42.4 ms
    64 bytes from alpha.blue-meltdown.net (50.56.249.136): icmp_seq=3 ttl=51 time=26.5 ms
    64 bytes from 50.56.249.136: icmp_seq=4 ttl=51 time=26.2 ms

    --- alpha.blue-meltdown.net ping statistics ---
    4 packets transmitted, 4 received, 0% packet loss, time 15543ms
    rtt min/avg/max/mdev = 26.231/32.620/42.463/6.730 ms
    17:49:47
    bob@intrepid ~/
    --> ping -c 4 www.blue-meltdown.net
    PING blue-meltdown.net (50.56.249.136) 56(84) bytes of data.
    64 bytes from alpha.blue-meltdown.net (50.56.249.136): icmp_seq=1 ttl=52 time=24.5 ms
    64 bytes from alpha.blue-meltdown.net (50.56.249.136): icmp_seq=2 ttl=51 time=24.3 ms
    64 bytes from alpha.blue-meltdown.net (50.56.249.136): icmp_seq=3 ttl=51 time=23.6 ms
    64 bytes from 50.56.249.136: icmp_seq=4 ttl=51 time=23.7 ms
    --- blue-meltdown.net ping statistics ---
    4 packets transmitted, 4 received, 0% packet loss, time 15091ms
    rtt min/avg/max/mdev = 23.608/24.076/24.525/0.384 ms
    

Figure 3.8. 'dig' DNS Name - Limited Return

'dig' DNS Name - Limited Return

In the image above, the `dig` command was used. Note that the results are limited. The "Answer" section has a '0', which means that nothing specific was queried or returned. However, it does show information about where the authoritative records are kept and the contact person for the domain.

Figure 3.9. 'dig' DNS Name Servers

'dig' DNS Name Servers

In the screenshot above, the 'ns' flag was passed to the `dig` command. This returned the name server entries.[7] The information is reliable, the "Answer" section is showing that info was successfully returned.

Figure 3.10. 'dig' DNS Specific Info

'dig' DNS Specific Info

The screenshot above shows a successful return of information about our machine "alpha". Note the command that was used.

Figure 3.11. 'dig' DNS CNAME Info

'dig' DNS CNAME Info

The final return of info shows the CNAME entry that we configured earlier, "www".

DNS Check Point

At this point, your RackSpace virtual machine should respond to `ping` commands by IP address and domain name. When this is in place, send me an email with your domain name and I'll verify that it's in place.



[7] Note that the name server info returned matches the entries that were in our configuration, above.