CT320: Network and System Administration

Fall 2018

DNS

See this page as a slide show

Domain Name System

The Problem

The Solution

Solution: The Domain Name System

DNS Development

$ grep '129.82.44.1[3-7][0-9]' /etc/hosts
129.82.44.130	austin.cs.colostate.edu austin
129.82.44.131	baton-rouge.cs.colostate.edu baton-rouge
129.82.44.132	bismarck.cs.colostate.edu bismarck
129.82.44.133	boise.cs.colostate.edu boise
129.82.44.134	boston.cs.colostate.edu boston
129.82.44.135	carson-city.cs.colostate.edu carson-city
129.82.44.136	charleston.cs.colostate.edu charleston
129.82.44.137	cheyenne.cs.colostate.edu cheyenne
129.82.44.138	columbia.cs.colostate.edu columbia
129.82.44.139	columbus-oh.cs.colostate.edu columbus-oh
129.82.44.140	concord.cs.colostate.edu concord
129.82.44.141	denver.cs.colostate.edu denver
129.82.44.142	des-moines.cs.colostate.edu des-moines
129.82.44.143	dover.cs.colostate.edu dover
129.82.44.144	frankfort.cs.colostate.edu frankfort
129.82.44.145	harrisburg.cs.colostate.edu harrisburg
129.82.44.146	hartford.cs.colostate.edu hartford
129.82.44.147	helena.cs.colostate.edu helena
129.82.44.148	honolulu.cs.colostate.edu honolulu
129.82.44.149	indianapolis.cs.colostate.edu indianapolis
129.82.44.150	jackson.cs.colostate.edu jackson
129.82.44.151	jefferson-city.cs.colostate.edu jefferson-city
129.82.44.152	juneau.cs.colostate.edu juneau
129.82.44.153	lansing.cs.colostate.edu lansing
129.82.44.154	lincoln.cs.colostate.edu lincoln
129.82.44.155	little-rock.cs.colostate.edu little-rock
129.82.44.156	madison.cs.colostate.edu madison
129.82.44.157	montgomery.cs.colostate.edu montgomery
129.82.44.158	montpelier.cs.colostate.edu montpelier
129.82.44.159	nashville.cs.colostate.edu nashville
129.82.44.160	oklahoma-city.cs.colostate.edu oklahoma-city
129.82.44.161	olympia.cs.colostate.edu olympia
129.82.44.162	phoenix.cs.colostate.edu phoenix
129.82.44.163	pierre.cs.colostate.edu pierre
129.82.44.164	providence.cs.colostate.edu providence
129.82.44.165	raleigh.cs.colostate.edu raleigh
129.82.44.166	richmond.cs.colostate.edu richmond
129.82.44.167	sacramento.cs.colostate.edu sacramento
129.82.44.168	saint-paul.cs.colostate.edu saint-paul
129.82.44.169	salem.cs.colostate.edu salem
129.82.44.170	salt-lake-city.cs.colostate.edu salt-lake-city
129.82.44.171	santa-fe.cs.colostate.edu santa-fe
129.82.44.172	springfield.cs.colostate.edu springfield
129.82.44.173	tallahassee.cs.colostate.edu tallahassee
129.82.44.174	topeka.cs.colostate.edu topeka
129.82.44.175	trenton.cs.colostate.edu trenton
129.82.44.176	washington-dc.cs.colostate.edu washington-dc
129.82.44.177	acorn.cs.colostate.edu acorn
129.82.44.178	almond.cs.colostate.edu almond

An Early Centralized System:

DNS Development

DNS Today

Domain Name Service Data

A typical host name: “denver.cs.colostate.edu.” is a Fully Qualified Domain Name (FQDN) made up of parts:

Domain Name Space

A partial DNS hierarchy

                    root
                      │
           ┌──────────┼───────┬───────┐
           │          │       │       │
          edu        com     mil     se
           │          │       │       │
         ┌─┴────┐     │       │       │
         │      │     │       │       │
    colostate  mit    hp      │      mil
         │                    │
     ┌───┼────┐             ┌─┴──┐
     │   │    │             │    │
    engr cs  www           af  navy
         │                  │
     ┌───┴────┐             │
     │        │             │
    www     denver       buckley

DNS Organization

                 root
                   │
           ┌───────┼────┬────┐
          edu     com  mil  se
         ┌─┴────┐  │    │    │
    colostate  mit hp   │   mil
     ┌───┼────┐       ┌─┴──┐
    engr cs  www     af  navy
     ┌───┴────┐       │
    www     denver buckley

DNS Query and Response

┌────────┐
│ Home   │
│ laptop │
│        │
└────────┘














My laptop’s browser wants the IP address of www.colostate.edu.

Step 1

┌────────┐                           ┌────────┐
│ Home   │--“www.colostate.edu?”(1)-▷│ Home   │
│ laptop │                           │ router │
│        │                           │        │
└────────┘                           └────────┘














My laptop doesn’t know the IP address, so it asks its smart friend.

Step 2

┌────────┐                           ┌────────┐
│ Home   │--“www.colostate.edu?”(1)-▷│ Home   │--“www.colostate.edu?”(2)┐
│ laptop │                           │ router │                         │
│        │                           │        │                         │
└────────┘                           └────────┘                         │
                                                                        ▽
                                                           ┌─────────────┐
                                                           │             │
                                                           │             │
                                                           │             │
                                                           │             │
                                                           │   Comcast   │
                                                           │     DNS     │
                                                           │   server    │
                                                           │             │
                                                           │             │
                                                           │             │
                                                           │             │
                                                           └─────────────┘

My router doesn’t know, either, so it asks its smart friend, the Comcast server.

Step 3

┌────────┐                           ┌────────┐
│ Home   │--“www.colostate.edu?”(1)-▷│ Home   │--“www.colostate.edu?”(2)┐
│ laptop │                           │ router │                         │
│        │                           │        │                         │
└────────┘                           └────────┘                         │
                                                                        ▽
                                                           ┌─────────────┐
┌────────────────────┐◁----“www.colostate.edu?”(3)---------│             │
│ j.root-servers.net │                                     │             │
└────────────────────┘                                     │             │
                                                           │             │
                                                           │   Comcast   │
                                                           │     DNS     │
                                                           │   server    │
                                                           │             │
                                                           │             │
                                                           │             │
                                                           │             │
                                                           └─────────────┘

The Comcast server doesn’t know, either, so it asks a random root server.

Step 4

┌────────┐                           ┌────────┐
│ Home   │--“www.colostate.edu?”(1)-▷│ Home   │--“www.colostate.edu?”(2)┐
│ laptop │                           │ router │                         │
│        │                           │        │                         │
└────────┘                           └────────┘                         │
                                                                        ▽
                                                           ┌─────────────┐
┌────────────────────┐◁----“www.colostate.edu?”(3)---------│             │
│ j.root-servers.net │                                     │             │
└────────────────────┘-----“Ask c.edu-servers.net”(4)-----▷│             │
                                                           │             │
                                                           │   Comcast   │
                                                           │     DNS     │
                                                           │   server    │
                                                           │             │
                                                           │             │
                                                           │             │
                                                           │             │
                                                           └─────────────┘

The root server doesn’t know the IP address, but it knows who handles .edu.

Step 5

┌────────┐                           ┌────────┐
│ Home   │--“www.colostate.edu?”(1)-▷│ Home   │--“www.colostate.edu?”(2)┐
│ laptop │                           │ router │                         │
│        │                           │        │                         │
└────────┘                           └────────┘                         │
                                                                        ▽
                                                           ┌─────────────┐
┌────────────────────┐◁----“www.colostate.edu?”(3)---------│             │
│ j.root-servers.net │                                     │             │
└────────────────────┘-----“Ask c.edu-servers.net”(4)-----▷│             │
                                                           │             │
┌────────────────────┐◁----“www.colostate.edu?”(5)---------│   Comcast   │
│ c.edu-servers.net  │                                     │     DNS     │
└────────────────────┘                                     │   server    │
                                                           │             │
                                                           │             │
                                                           │             │
                                                           │             │
                                                           └─────────────┘

The Comcast DNS server asks the .edu server to resolve www.colostate.edu.

Step 6

┌────────┐                           ┌────────┐
│ Home   │--“www.colostate.edu?”(1)-▷│ Home   │--“www.colostate.edu?”(2)┐
│ laptop │                           │ router │                         │
│        │                           │        │                         │
└────────┘                           └────────┘                         │
                                                                        ▽
                                                           ┌─────────────┐
┌────────────────────┐◁----“www.colostate.edu?”(3)---------│             │
│ j.root-servers.net │                                     │             │
└────────────────────┘-----“Ask c.edu-servers.net”(4)-----▷│             │
                                                           │             │
┌────────────────────┐◁----“www.colostate.edu?”(5)---------│   Comcast   │
│ c.edu-servers.net  │                                     │     DNS     │
└────────────────────┘-----“Ask dns1.colostate.edu”(6)----▷│   server    │
                                                           │             │
                                                           │             │
                                                           │             │
                                                           │             │
                                                           └─────────────┘

The .edu server knows several authoritative servers for .colostate.edu.

Step 7

┌────────┐                           ┌────────┐
│ Home   │--“www.colostate.edu?”(1)-▷│ Home   │--“www.colostate.edu?”(2)┐
│ laptop │                           │ router │                         │
│        │                           │        │                         │
└────────┘                           └────────┘                         │
                                                                        ▽
                                                           ┌─────────────┐
┌────────────────────┐◁----“www.colostate.edu?”(3)---------│             │
│ j.root-servers.net │                                     │             │
└────────────────────┘-----“Ask c.edu-servers.net”(4)-----▷│             │
                                                           │             │
┌────────────────────┐◁----“www.colostate.edu?”(5)---------│   Comcast   │
│ c.edu-servers.net  │                                     │     DNS     │
└────────────────────┘-----“Ask dns1.colostate.edu”(6)----▷│   server    │
                                                           │             │
┌────────────────────┐◁----“www.colostate.edu?”(7)---------│             │
│ dns1.colostate.edu │                                     │             │
└────────────────────┘                                     │             │
                                                           └─────────────┘

The Comcast server asks dns1.colostate.edu to resolve the name.

Step 8

┌────────┐                           ┌────────┐
│ Home   │--“www.colostate.edu?”(1)-▷│ Home   │--“www.colostate.edu?”(2)┐
│ laptop │                           │ router │                         │
│        │                           │        │                         │
└────────┘                           └────────┘                         │
                                                                        ▽
                                                           ┌─────────────┐
┌────────────────────┐◁----“www.colostate.edu?”(3)---------│             │
│ j.root-servers.net │                                     │             │
└────────────────────┘-----“Ask c.edu-servers.net”(4)-----▷│             │
                                                           │             │
┌────────────────────┐◁----“www.colostate.edu?”(5)---------│   Comcast   │
│ c.edu-servers.net  │                                     │     DNS     │
└────────────────────┘-----“Ask dns1.colostate.edu”(6)----▷│   server    │
                                                           │             │
┌────────────────────┐◁----“www.colostate.edu?”(7)---------│             │
│ dns1.colostate.edu │                                     │             │
└────────────────────┘-----“It is 129.82.103.106”(8)------▷│             │
                                                           └─────────────┘

The dns1.colostate.edu server, on the CSU campus, replies with the IP address.

Step 9

┌────────┐                           ┌────────┐
│ Home   │--“www.colostate.edu?”(1)-▷│ Home   │--“www.colostate.edu?”(2)┐
│ laptop │                           │ router │                         │
│        │                           │        │◁--“129.82.103.106”(9)   │
└────────┘                           └────────┘                     △   │
                                                                    │   ▽
                                                           ┌─────────────┐
┌────────────────────┐◁----“www.colostate.edu?”(3)---------│             │
│ j.root-servers.net │                                     │             │
└────────────────────┘-----“Ask c.edu-servers.net”(4)-----▷│             │
                                                           │             │
┌────────────────────┐◁----“www.colostate.edu?”(5)---------│   Comcast   │
│ c.edu-servers.net  │                                     │     DNS     │
└────────────────────┘-----“Ask dns1.colostate.edu”(6)----▷│   server    │
                                                           │             │
┌────────────────────┐◁----“www.colostate.edu?”(7)---------│             │
│ dns1.colostate.edu │                                     │             │
└────────────────────┘-----“It is 129.82.103.106”(8)------▷│             │
                                                           └─────────────┘

The Comcast server sends the IP address to my home router.

Step 10

┌────────┐                           ┌────────┐
│ Home   │--“www.colostate.edu?”(1)-▷│ Home   │--“www.colostate.edu?”(2)┐
│ laptop │                           │ router │                         │
│        │◁--“129.82.103.106”(10)----│        │◁--“129.82.103.106”(9)   │
└────────┘                           └────────┘                     △   │
                                                                    │   ▽
                                                           ┌─────────────┐
┌────────────────────┐◁----“www.colostate.edu?”(3)---------│             │
│ j.root-servers.net │                                     │             │
└────────────────────┘-----“Ask c.edu-servers.net”(4)-----▷│             │
                                                           │             │
┌────────────────────┐◁----“www.colostate.edu?”(5)---------│   Comcast   │
│ c.edu-servers.net  │                                     │     DNS     │
└────────────────────┘-----“Ask dns1.colostate.edu”(6)----▷│   server    │
                                                           │             │
┌────────────────────┐◁----“www.colostate.edu?”(7)---------│             │
│ dns1.colostate.edu │                                     │             │
└────────────────────┘-----“It is 129.82.103.106”(8)------▷│             │
                                                           └─────────────┘

My home router tells my laptop the IP address.

Caching

That was the worst case. Really, caching occurs at all levels:

Caching

But, for how long?

Redundancy

Multiple servers for each zone in case any one server fails:

Querying

Types of DNS Servers

Types of Queries

Recursive query:

Iterated query:

Iterated/Recursive Clerks

Typical trip to a hardware store:

Jack: “I’m looking for a Torx T8 driver.”
Clerk: “Look in aisle 6.”

Ideal trip to a hardware store:

Jack: “I’m looking for a Torx T8 driver.”
Clerk: “I’ll get one for you.”
Clerk fetches one.
Clerk: “Here you are.”

Either system works, I suppose.

DNS Caching

DNS Record Types: SOA

The Start of Authority (SOA) record defines global parameters for a “zone”:

DNS Record Types: SOA (cont.)

DNS RFC defines a text representation for records as well as a binary or “wire” representation. SOA records have the following text format:

    ; Name             TTL  Class RType Email
    acns.colostate.edu 3600 IN    SOA   dnsadmin.colostate.edu. (
        249427 ; sn
        900    ; refresh (15 min)
        600    ; retry (10 min)
        86400  ; expiry (1 day)
        3600   ; minTTL (1 hour)
    )

DNS Record Types: NS

Name Server (NS): Defines the authoritative name server(s) for a domain. Actually located both at the root of the zone and at the point of delegation in the parent zone.

The NS records for acns.colostate.edu reside in the parent zone, “colostate.edu”, like this :

    Name    TTL	Class	RecordType  Data
    acns	IN	NS	    dns1.colostate.edu
    acns	IN	NS	    dns2.colostate.edu

And they exist in the acns.colostate.edu zone where they look like:

    Name    TTL	Class	RecordType  Data
    @		IN	NS	    dns1.colostate.edu
    @		IN	NS	    dns2.colostate.edu

DNS Record Types: A, AAAA

IPv4 Address (A): Associates a name with an IPv4 address The A record for chico.cs.colostate.edu resides in the “cs.colostate.edu” zone and looks like:

    Name    TTL	Class	RecordType  Data
    www		IN	A	    129.82.45.30

IPv6 Address (AAAA): Associates a name with an IPv6 address An AAAA record looks like:

    Name    TTL	Class	RecordType  Data
    www		IN	AAAA	    2002:8152:e6d2::8052:f8d1

DNS Record Types: CNAME

Canonical Name (CNAME): Associates an alias with another DNS name record. The CNAME record for www.cs.colostate.edu looks like:

    Name    TTL	Class	RecordType  Data
    www		IN	CNAME	    parsons.cs.colostate.edu

According to the RFC, you may not create any other records with the same name as a CNAME record. Recently added exceptions for DNSSEC record types RRSIG, NSEC and KEY.

Other DNS Record Types

Others… There are ~71 record types. The other, more common records include:

DNS Forward and Reverse Lookups

This is also a tree structure, delegated in a similar fashion. All reverse space is rooted in the special domain called “in-addr.arpa”

For delegation to work as in the forward space, the networks are listed most specific to least specific. Thus CSU’s IP space (129.82/16) has a reverse DNS zone of “82.129.in-addr.arpa”

DNS Reverse Data Organization

         arpa
           │
        in-addr
           │
     ┌─────┼─────┐
    128   129   130
           │
     ┌─────┼─────┐
    81    82    83
           │
     ┌─────┼─────┐
    44    45    46
           │
     ┌─────┼─────┐
    113   114   115
$ host www.cs.colostate.edu
www.cs.colostate.edu is an alias for parsons.cs.colostate.edu.
parsons.cs.colostate.edu has address 129.82.45.114

$ host 129.82.45.114
114.45.82.129.in-addr.arpa domain name pointer parsons.cs.colostate.edu.
114.45.82.129.in-addr.arpa domain name pointer cs.colostate.edu.

DNS Authorities

Internet Assigned Numbers Authority (IANA) and Internet Network Information Center (InterNIC) originally established by various US Government agencies and now run under contract by a private, non-profit organization.

Internet Corporation for Assigned Names and Numbers (ICANN) is responsible for:

DNS Registries and Registrars

DNS Registry — the authoritative source for a DNS domain.

DNS Registrar — entity authorized to manage registry data.

DNS Server Software

Dynamic DNS

Dynamic DNS (DDNS) — Allows clients to update A and PTR records on the fly. It’s handy when your ISP doesn’t guarantee a constant IP address.

DNS Commands

CommandPurpose
pingPing and incidentally reveal IP address
nslookupShow DNS record info
digGet DNS record info
hostGet DNS record info
whoisGet contact information

ping example

$ ping -c2 localhost
PING localhost (127.0.0.1) 56(84) bytes of data.
64 bytes from localhost (127.0.0.1): icmp_seq=1 ttl=64 time=0.017 ms
64 bytes from localhost (127.0.0.1): icmp_seq=2 ttl=64 time=0.023 ms

--- localhost ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 999ms
rtt min/avg/max/mdev = 0.017/0.020/0.023/0.003 ms

nslookup example

$ nslookup whitehouse.gov
Server:		129.82.45.181
Address:	129.82.45.181#53

Non-authoritative answer:
Name:	whitehouse.gov
Address: 104.66.38.156

dig example

$ dig www.frii.com

; <<>> DiG 9.9.4-RedHat-9.9.4-61.el7 <<>> www.frii.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 58224
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 3

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;www.frii.com.			IN	A

;; ANSWER SECTION:
www.frii.com.		1800	IN	A	216.17.136.180

;; AUTHORITY SECTION:
frii.com.		3600	IN	NS	ns2.frii.net.
frii.com.		3600	IN	NS	ns1.frii.net.

;; ADDITIONAL SECTION:
ns1.frii.net.		405226	IN	A	216.17.128.1
ns2.frii.net.		405226	IN	A	216.17.128.2

;; Query time: 29 msec
;; SERVER: 129.82.45.181#53(129.82.45.181)
;; WHEN: Thu Apr 19 15:16:03 MDT 2018
;; MSG SIZE  rcvd: 133

host example

$ host ebay.com
ebay.com has address 66.135.209.52
ebay.com has address 66.135.216.190
ebay.com has address 66.211.185.25
ebay.com has address 66.211.181.123
ebay.com has address 66.211.160.86
ebay.com has address 66.211.162.12
ebay.com mail is handled by 10 lore.ebay.com.
ebay.com mail is handled by 10 gort.ebay.com.
ebay.com mail is handled by 10 data.ebay.com.

whois example

$ whois colostate.edu | sed '1,/^---/d'

Domain Name: COLOSTATE.EDU

Registrant:
   Colorado State University
   Colorado State University
   Ft. Collins, CO 80523
   UNITED STATES

Administrative Contact:
   Scott Baily
   Colorado State University
   Academic Computing and Network Services
   Fort Collins, CO 80523
   UNITED STATES
   (970) 491-5600
   scott.baily@colostate.edu

Technical Contact:
   Mike Willard
   IT Pro III
   Academic Computing and Networking Services
   Colorado State University
   Fort Collins, CO 80523
   UNITED STATES
   (970) 491-4651
   dns.admin@colostate.edu

Name Servers: 
   DNS1.COLOSTATE.EDU      129.82.103.121
   DNS2.COLOSTATE.EDU      165.127.125.178
   DNS3.COLOSTATE.EDU      129.82.103.111

Domain record activated:    27-May-1987
Domain record last updated: 23-May-2017
Domain expires:             31-Jul-2018


Web sites

These websites can look up things for you:

User: Guest

Check: HTML CSS
Edit History Source

Modified: 2017-12-19T09:08

Apply to CSU | Contact CSU | Disclaimer | Equal Opportunity
Colorado State University, Fort Collins, CO 80523 USA
© 2018 Colorado State University
CS Building