Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Lab 2: Application Layer DNS - Using nslookup and ipconfig Tools, Lecture notes of Communication

Instructions for a lab that involves using the nslookup and ipconfig tools to explore the Domain Name System (DNS) and its role in translating hostnames to IP addresses. The lab covers the client side of DNS, including how to send queries to a local DNS server and interpret the responses. It also includes exercises on using nslookup to obtain the IP address of a Web server in Europe, determine the authoritative DNS servers for a university in Asia, and query a specific DNS server for the mail servers for Yahoo! mail. The ipconfig utility is used to display TCP/IP information and manage the DNS information stored in a host. The lab also covers tracing DNS with Wireshark and examining DNS query and response messages.

What you will learn

  • How can the nslookup tool be used to query a DNS server for a DNS record?
  • What is the general syntax of nslookup commands?
  • How can the ipconfig utility be used to display TCP/IP information and manage the DNS information stored in a host?

Typology: Lecture notes

2021/2022

Uploaded on 09/27/2022

paulina
paulina 🇺🇸

4.4

(13)

241 documents

1 / 7

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
ECE 2305: Introduction to Communications and Networks D-term 2014
Homework+Lab 2: Due at start of class on 01-Apr.
Please complete all five homework problems, and the twenty lab problems.
Homework Problems
1. Stallings Problem 2.4 from the “Problems” section, not the “Review Questions”.
2. Stallings Problem 2.7.
3. The signal x(t) = 1
2sin(t) (in volts) undergoes an attenuation of 6 dB. What is the peak-to-
peak voltage of the attenuated signal?
4. Suppose a communication system needs 11 dB SNR for reliable communication. Assume that
the noise floor is -100 dBm, and that a fiber optic cable with an attenuation of 0.12 dB/km
is chosen to connect the transmitter and receiver. What is the required transmit power (in
watts) if there is 40 km of cable between the transmitter and receiver?
5. Stallings Problem 4.3.
1
pf3
pf4
pf5

Partial preview of the text

Download Lab 2: Application Layer DNS - Using nslookup and ipconfig Tools and more Lecture notes Communication in PDF only on Docsity!

ECE 2305: Introduction to Communications and Networks D-term 2014 Homework+Lab 2: Due at start of class on 01-Apr. Please complete all five homework problems, and the twenty lab problems.

Homework Problems

  1. Stallings Problem 2.4 from the “Problems” section, not the “Review Questions”.
  2. Stallings Problem 2.7.
  3. The signal x(t) = 12 sin(t) (in volts) undergoes an attenuation of 6 dB. What is the peak-to- peak voltage of the attenuated signal?
  4. Suppose a communication system needs 11 dB SNR for reliable communication. Assume that the noise floor is -100 dBm, and that a fiber optic cable with an attenuation of 0.12 dB/km is chosen to connect the transmitter and receiver. What is the required transmit power (in watts) if there is 40 km of cable between the transmitter and receiver?
  5. Stallings Problem 4.3.

Lab 2: Application Layer DNS

[adapted from J. Kurose and K.W. Ross] Before starting this lab, please make sure you have read section 24.2 in the textbook. As described in the textbook, the Domain Name System (DNS) translates hostnames to IP addresses, fulfilling a critical role in the Internet infrastructure. In this lab, we’ll take a closer look at the client side of DNS. Recall that the client’s role in the DNS is relatively simple — a client sends a query to its local DNS server, and receives a response back. As shown in Figure 24.6 in the textbook, much can go on behind the scenes, invisible to the DNS clients, as the hierarchical DNS servers communicate with each other to either recursively or iteratively resolve the client’s DNS query. From the DNS client’s standpoint, however, the protocol is quite simple — a query is formulated to the local DNS server and a response is received from that server. What to hand in: There are twenty questions below which you will encounter as you complete the lab. For each question, please provide the answer as well as necessary screenshots and packet printouts to support your answer.

Part I: nslookup^1

In this lab, we’ll make extensive use of the 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 its 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.

Figure 1: Screenshot demonstrating use of nslookup (^1) OS X and Linux users (and Windows users who have installed Cygwin) may consider using dig rather than nslookup since dig is a more modern tool with more detailed outputs and is actively maintained.

  1. Run nslookup to determine the authoritative DNS servers for a university in Asia.
  2. Run nslookup so that one of the DNS servers obtained in Question 2 is queried for the mail servers for Yahoo! mail.

Part II: ipconfig

The ipconfig (for Windows) and ifconfig (for Linux/Unix/Mac) utilities are among the most useful little in your host, especially for debugging network issues. Here we’ll only describe ipconfig, although the Linux/Unix/Mac ifconfig is very similar^2. 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 want to see all this information about your host, simply enter:

ipconfig /all

into the Command Prompt, as shown in the screenshot in Fig. 2.

Figure 2: Screenshot demonstrating use of ipconfig

ipconfig is also very useful for managing the DNS information stored in your host. As men- tioned in section 24.2 of the text, a host can cache DNS records it recently obtained. To see these cached records, after the command prompt 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.

(^2) Type man ifconfig for help with this utility in Linux/Unix

Part III: Tracing DNS with Wireshark (and stuff to hand in)

Now that we are familiar with nslookup and ipconfig, we’re ready to put it to use. Let’s first capture the DNS packets that are generated by ordinary web browsing activity.

  • Use ipconfig to empty/flush 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. With Firefox, go to Tools and select Clear Private Data)
  • Open Wireshark and enter ip.addr == your IP address into the filter, where you obtain your IP address (the IP address for the computer on which you are running Wireshark) 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.

Answer the following questions:

  1. Locate the DNS query and response messages. Are they sent using the UDP or TCP protocol?
  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. Examine the DNS query message. What “Type” of DNS query is it^3? Does the query message contain any “answers”?
  5. Examine the DNS response message. How many “answers” are provided? What does each of 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?

(^3) A table of all the different “types” is available in your textbook (see “resource record types”).

  1. Examine the DNS response message. How many “answers” are provided? What does each of these answers contain? Provide a screenshot.

Now repeat the previous experiment, but instead issue the command:

nslookup -type=NS mit.edu

Answer the following questions:

  1. To what IP address is the DNS query message sent? Is this the IP address of your default local DNS server?
  2. Examine the DNS query message. What “Type” of DNS query is it? Does the query message contain any “answers”?
  3. Examine the DNS response message. What MIT name servers does the response message provide? Does this response message also provide the IP addresses of the MIT name servers? Provide a screenshot.

Now repeat the previous experiment, but instead issue the command:

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

Answer the following questions:

  1. 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?
  2. Examine the DNS query message. What “Type” of DNS query is it? Does the query message contain any “answers”?
  3. Examine the DNS response message. How many “answers” are provided? What does each of these answers contain? Provide a screenshot.