0% found this document useful (0 votes)
62 views

Lab 4

This document provides instructions and activities for students to better understand the client side of DNS through using networking tools like nslookup and Wireshark. The activities have students: 1) Use nslookup to query DNS servers for domain name and IP address lookups, and observe the responses. 2) Use ipconfig to view host TCP/IP settings and flush the DNS cache. 3) Capture network traffic with Wireshark during web browsing and DNS queries to analyze the DNS and TCP protocols. 4) Repeat DNS queries and captures using nslookup to observe DNS transactions. The goal is for students to gain hands-on experience with DNS client operations.

Uploaded by

Saleem Iqbal
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
62 views

Lab 4

This document provides instructions and activities for students to better understand the client side of DNS through using networking tools like nslookup and Wireshark. The activities have students: 1) Use nslookup to query DNS servers for domain name and IP address lookups, and observe the responses. 2) Use ipconfig to view host TCP/IP settings and flush the DNS cache. 3) Capture network traffic with Wireshark during web browsing and DNS queries to analyze the DNS and TCP protocols. 4) Repeat DNS queries and captures using nslookup to observe DNS transactions. The goal is for students to gain hands-on experience with DNS client operations.

Uploaded by

Saleem Iqbal
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

LAB # 04

Statement Purpose:
To take a closer look at the client side of DNS. While execution of a DNS query, much can go

communicate with each other to either recursively or iteratively resolve the clie
query.
Activity outcomes:
Students will be able to better understand the working of DNS

Instructor Note:

observations on them.

1) StageJ(Journey)

Introduction
nslookup
nslookup tool, which is available in most
Linux/Unix and Microsoft platforms today. To run nslookup in Linux/Unix, you just type the
nslookup command on the command line. To run it in Windows, open the Command Prompt
and run nslookup on the command line.
In it is most basic operation, nslookup tool allows the host running the tool to query any
specified DNS server for a DNS record. The queried DNS server can be a root DNS server, a
top-level-domain DNS server, an authoritative DNS server, or an intermediate DNS server
(see the textbook for definitions of these terms). To accomplish this task, nslookup sends a
DNS query to the specified DNS server, receives a DNS reply from that same DNS server, and
displays the result.

CCSxxx Lab Manual 38


The above screenshot shows the results of three independent nslookup commands (displayed in the
Windows Command Prompt). In this example, the client host is located on the campus of
Polytechnic University in Brooklyn, where the default local DNS server is dns-prime.poly.edu. When
running nslookup, if no DNS server is specified, then nslookup sends the query to the default DNS
server, which in this case is dns-prime.poly.edu. Consider the first command:

nslookup www.mit.edu

shown in the screenshot, the response from this command provides two pieces of information: (1)
the name and IP address of the DNS server that provides the answer; and (2) the answer itself, which
is the host name and IP address of www.mit.edu. Although the response came from the local DNS
server at Polytechnic University, it is quite possible that this local DNS server iteratively contacted
several other DNS servers to get the answer, as described in Section 2.5 of the textbook.
Now consider the second command:

nslookup type=NS mit.edu

-
nslookup to send a query for a type-NS record to the default local DNS server. In words, the query is
type
option is not used, nslookup uses the default, which is to query for type A records.) The answer,
displayed in the above screenshot, first indicates the DNS server that is providing the answer (which
is the default local DNS server) along with three MIT nameservers. Each of these servers is indeed an
authoritative DNS server for the hosts on the MIT campus. However, nslookup also indicates that the
-
than from an authoritative MIT DNS server. Finally, the answer also includes the IP addresses of the
authoritative DNS servers at MIT. (Even though the type-NS query generated by nslookup did not
nslookup
displays the result.)
Now finally consider the third command:

nslookup www.aiit.or.kr bitsy.mit.edu

In this example, we indicate that we want to the query sent to the DNS server bitsy.mit.edu rather
than to the default DNS server (dns-prime.poly.edu). Thus, the query and reply transaction takes
place directly between our querying host and bitsy.mit.edu. In this example, the DNS server
bitsy.mit.edu provides the IP address of the host www.aiit.or.kr, which is a web server at the
Advanced Institute of Information Technology (in Korea).
Now that we have gone through a few illustrative examples, you are perhaps wondering about the
general syntax of nslookup commands. The syntax is:

nslookup option1 option2 host-to-find dns-server

In general, nslookup can be run with zero, one, two or more options. And as we have seen in the
above examples, the dns-server is optional as well; if it is not supplied, the query is sent to the
default local DNS server.

CCSxxx Lab Manual 39


2) Stage a1 (apply)
Lab Activities:
Activity 1:
Now that we have provided an overview of nslookup, it is time for you to test drive it yourself. Do
the following (and write down the results):
6. Run nslookup to obtain the IP address of a Web server in Asia. What is the IP address of that
server?
7. Run nslookup to determine the authoritative DNS servers for a university in Europe.
8. Run nslookup so that one of the DNS servers obtained in Question 2 is queried for the mail
servers for Yahoo! mail. What is its IP address?

Solution:
ipconfig
ipconfig (for Windows) and ifconfig (for Linux/Unix) are among the most useful little utilities in
your
ipconfig, although the
Linu

x/Unix ifconfig is very


similar. ipconfig can be used to show your current TCP/IP information, including your address,
DNS server addresses, adapter type and so on. For example, if you all this information about your
host simply by entering
ipconfig \all
into the Command Prompt, as shown in the following screenshot.

CCSxxx Lab Manual 40


ipconfig is also very useful for managing the DNS information stored in your host. In Section 2.5 we
learned that a host can cache DNS records it recently obtained. To see these cached records, after
the prompt C:\> provide the following command:
ipconfig /displaydns
Each entry shows the remaining Time to Live (TTL) in seconds. To clear the cache, enter
ipconfig /flushdns
Flushing the DNS cache clears all entries and reloads the entries from the hosts file

Activity 2:
Now that we are familiar with nslookup and ipconfig
-surfing activity.
Use ipconfig to empty the DNS cache in your host.
Open your browser and empty your browser cache. (With Internet Explorer, go to Tools
menu and select Internet Options; then in the General tab select Delete Files.)

obtain your_IP_address with ipconfig. This filter removes all packets that neither
originate nor are destined to your host.
Start packet capture in Wireshark.
With your browser, visit the Web page: http://www.ietf.org
Stop packet capture.

If you are unable to run Wireshark on a live network connection, you can download a packet trace
3
. Answer
the following questions. Whenever possible, when answering a question below, you should hand in a
printout of the packet(s) within the trace that you used to answer the question asked. Annotate the
printout4 to explain your answer. To print a packet, use File->Print, choose Selected packet only,
choose Packet summary line, and select the minimum amount of packet detail that you need to
answer the question.
1. Locate the DNS query and response messages. Are then sent over UDP or TCP?
2. What is the destination port for the DNS query message? What is the source port of DNS
response message?
3. To what IP address is the DNS query message sent? Use ipconfig to determine the IP address
of your local DNS server. Are these two IP addresses the same?
4.

5.
these answers contain?
6. Consider the subsequent TCP SYN packet sent by your host. Does the destination IP address
of the SYN packet correspond to any of the IP addresses provided in the DNS response
message?
7. This web page contains images. Before retrieving each image, does your host issue new DNS
queries?

CCSxxx Lab Manual 41


Activity 3:
nslookup5.
Start packet capture.
Do an nslookup on www.mit.edu
Stop packet capture.

CCSxxx Lab Manual 42


You should get a trace that looks something like the following:

We see from the above screenshot that nslookup actually sent three DNS queries and received three
DNS responses. For the purpose of this assignment, in answering the following questions, ignore the
first two sets of queries/responses, as they are specific to nslookup and are not normally generated
by standard Internet applications. You should instead focus on the last query and response
messages.
1. What is the destination port for the DNS query message? What is the source port of DNS
response message?
2. To what IP address is the DNS query message sent? Is this the IP address of your default local
DNS server?
3.

4.
these answers contain?
5. Provide a screenshot.

Solution:

CCSxxx Lab Manual 43


\

Activity 4:
Now repeat the previous experiment, but instead issue the command:
nslookup type=NS mit.edu
Answer the following questions6 :

1. To what IP address is the DNS query message sent? Is this the IP address of your default local
DNS server?
2.

3. Examine the DNS response message. What MIT nameservers does the response message
provide? Does this response message also provide the IP addresses of the MIT namesers?
4. Provide a screenshot.

CCSxxx Lab Manual 44


3) Stage v (verify)
Home Activities:
Activity 1:
Repeat the previous experiment, but instead issue the command:
nslookup www.aiit.or.kr bitsy.mit.edu
Answer the following questions7:
To what IP address is the DNS query message sent? Is this the IP address of your default local
DNS server? If not, what does the IP address correspond to?

these answers contain?


Provide a screenshot.

4) Stage a2 (assess)
Submit the home activity before next lab

CCSxxx Lab Manual 45

You might also like