Seminar 8: Explore the Hierarchy of DNS Servers using DIG Tool
Goal:
- To use the functionality of DIG Tool in exploring the hierarchy of DNS Servers
- Use DIG tool's trace functionality to create iterative queries.
Description:
- DIG (Domain Information Groper) is a robust command-line tool for querying DNS nameservers.
- It can identify IP address records, record the query route as it obtains answers from an authoritative nameserver and diagnose other DNS problems.
- It performs DNS lookups and displays the answers that are returned from the name server(s) that were queried.
- Most DNS administrators use dig to troubleshoot DNS problems because of its flexibility, ease of use and clarity of output. Other lookup tools tend to have less functionality than dig.
How to Install DIG
- For Windows
- For Linux/Mac, you can access the DIG Tool directly from terminal.
Usage
- The DIG can be invoked from the command-line/terminal using the command:
$ dig @server name type
- server - name or IP address of the name server to be queried.
- It can be IPv4 address in dotted-decimal notation or an IPv6 address in colon-delimited notation.
- When the supplied server argument is a hostname, dig resolves that name before querying that name server.
- If no server argument is provided, dig consults /etc/resolv.conf and queries the name servers listed there. The reply from the name server that responds is displayed.
- name - name of the resource record that is to be looked up.
- type - indicates what type of query is required - ANY, A, MX, SIG, etc. type can be any valid query type. If no type argument is supplied, dig will perform a lookup for an A record. The List of record types can be found here
- server - name or IP address of the name server to be queried.
A screenshot of simple usage is shown here:
More on Definitions
EXERCISE
- Use the DIG tool to explore the hierarchy of DNS servers. Recall that in slide 43 from Naming lecture, a DNS server higher in the DNS hierarchy delegates a DNS query to a DNS server lower in the hierarchy, by sending back to the DNS client the name of that lower-‐level DNS server. First read the instructions given above and then answer the following questions.
- Starting with a root DNS server (from one of the root servers [a-‐m].root-‐servers.net], initiate a sequence of queries for the IP address for our computer science department’s Web server by using dig. Show the list of the names of DNS servers in the delegation chain in answering your query.
- Repeat above for several popular Web sites -
- AMAZON
Back up your answers with screen shots that show the results of your dig queries, and explain in detail the look up process.
Deliverables of practical session: A zip file with PDF file containing the answers to above exercise and screenshots that show the results to above queries.
Steps in Iterative DNS Query
- A query starts from a DNS server, which can return available root servers world-wide.
- For this DNS server, we will use Google Public DNS, with the address 8.8.8.8, as it is the most common and one of the fastest public DNS servers.
- While the DNS server can be recursive, meaning it will hide the intermediate results from the client, we will be using the dig tool’s trace functionality, which creates an iterative query.
- The dig utility will first send Google Public DNS server a query of root servers, and the DNS (Google) server will answer with a list of root server domain names and IPs.
- An example of a root server is f.root-servers.net.
- Next, the dig utility will select one of the root servers and query it for a top level domain (TLD) DNS server associated with the domain in question.
- For https://cs.ut.ee , the TLD is “ee”, and one of the TLD servers returned is ns.tld.ee.
- Next, dig will query ns.tld.ee for compatible authoritative name servers for ut.ee, one of which, in our example, is ns2.ut.ee.
- Finally, the domain in question is sent to the authoritative name server (ns.ut.ee), which replies with the IP address of the domain www.cs.ut.ee , ending the iterative DNS query.
Command:
$ dig +trace +noall @8.8.8.8 www.cs.ut.ee
REFERENCES: