3.1.9 Lab - DNS Lookups
3.1.9 Lab - DNS Lookups
Objectives
Passive reconnaissance is a method of information gathering in which the tools do not interact directly with
the target device or network. In this lab, you will explore common tools used to gather information about a
target through the Domain Name System (DNS).
Use nslookup to obtain domain and IP address information.
Use the whois command to find additional registration information.
Compare the Output of the Nslookup and Dig tools.
Perform Reverse DNS Lookups.
Background / Scenario
Before beginning any penetration test or other ethical hacking engagement, you need to covertly obtain as
much information about the target organization as possible. There is a wealth of information that can be
obtained from publicly available domain registration data. In this lab, you will investigate the output of the
nslookup, whois, and dig commands.
Required Resources
Kali VM customized for Ethical Hacker course
Internet access
Instructions
Step 1: Log into Kali Linux and access the terminal environment.
a. Log into the Kali system with the username kali and the password kali. You are presented with the Kali
desktop.
b. Open a terminal window by clicking on the Terminal icon located near the top of the screen.
┌──(kali㉿Kali)-[~]
└─$ man nslookup
b. To review the manual pages, press the spacebar to advance the pages. When you are finished reviewing
the manual pages, press q to quit and return to the command line.
Which set keyword would you use to query for the mail server mx record within a domain?
Type your answers here.
© 2023 - 2025 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 1 of 8
Lab - DNS Lookups
┌──(kali㉿Kali)-[~]
└─$ nslookup
> cisco.com
Server: 192.168.1.1
Address: 192.168.1.1#53
Non-authoritative answer:
Name: cisco.com
Address: 72.163.4.185
Name: cisco.com
Address: 2001:420:1101:1::185
>
c. To find the domain name servers configured for cisco.com, use the set type command to change the
query type to “ns” to return the name server information.
> set type=ns
> cisco.com
The output of the command should be similar to that shown below. The servers are listed by fully qualified
domain name and are further listed as authoritative servers for both IPv4 and IPv6 addresses.
> set type=ns
> cisco.com
;; communications error to 192.168.1.1#53: timed out
Server: 192.168.1.1
Address: 192.168.1.1#53
Non-authoritative answer:
cisco.com nameserver = ns1.cisco.com.
cisco.com nameserver = ns3.cisco.com.
cisco.com nameserver = ns2.cisco.com.
© 2023 - 2025 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 2 of 8
Lab - DNS Lookups
┌──(kali㉿Kali)-[~]
└─$ nslookup skillsforall.com 8.8.8.8
In interactive mode, you change the server using the server keyword.
┌──(kali㉿Kali)-[~]
└─$ nslookup
> server 8.8.8.8
> skillsforall.com
b. The any query type can retrieve much, or all, of the information contained in the DNS record for a host
name. Often text records that can provide additional details about the domain are contained in DNS
records. Using the 8.8.8.8 Google DNS server, find the DNS records for skillsforall.com.
┌──(kali㉿Kali)-[~]
└─$ nslookup
> server 8.8.8.8
> set type=any
> skillsforall.com
The output should look similar to this example:
┌──(kali㉿Kali)-[~]
└─$ nslookup
> server 8.8.8.8
Default server: 8.8.8.8
Address: 8.8.8.8#53
> set type=any
> skillsforall.com
;; Connection to 8.8.8.8#53(8.8.8.8) for skillsforall.com failed: timed out.
Server: 8.8.8.8
Address: 8.8.8.8#53
Non-authoritative answer:
Name: skillsforall.com
Address: 13.225.142.127
Name: skillsforall.com
Address: 13.225.142.7
Name: skillsforall.com
Address: 13.225.142.73
Name: skillsforall.com
Address: 13.225.142.9
skillsforall.com nameserver = ns-1130.awsdns-13.org.
skillsforall.com nameserver = ns-1652.awsdns-14.co.uk.
© 2023 - 2025 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 3 of 8
Lab - DNS Lookups
┌──(kali㉿Kali)-[~]
└─$ whois cisco.com
b. Now use the whois command to obtain information about the skillsforall.com domain.
What conclusion can you make about the two domains (cisco.com and skillsforall.com) based on the
output of the whois commands?
<Type answer here>
© 2023 - 2025 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 4 of 8
Lab - DNS Lookups
┌──(kali㉿Kali)-[~]
└─$ whois 72.163.5.201
#
# ARIN WHOIS data and services are subject to the Terms of Use
# available at: https://www.arin.net/resources/registry/whois/tou/
#
# If you see inaccuracies in the results, please report at
# https://www.arin.net/resources/registry/whois/inaccuracy_reporting/
#
# Copyright 1997-2023, American Registry for Internet Numbers, Ltd.
#
OrgTechHandle: CAMT-ARIN
OrgTechName: Cisco address management team
<output omitted>
What is the IP address range for the IPv4 addresses allocated to Cisco? The ns1.cisco.com server is
addressed within this block.
<Type your answer here>
c. Because organizations may use the same IP networks for other externally facing servers, knowing the
address ranges is valuable for determining which networks to target during a penetration test. Use the
whois tool to obtain the IP address allocations for the IP networks where the other Cisco DNS servers are
located.
© 2023 - 2025 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 5 of 8
Lab - DNS Lookups
┌──(kali㉿Kali)-[~]
└─$ dig cisco.com
What is the difference between the default record types queried by Dig and those queried by nslookup?
<Type your answer here>
b. To obtain the IPv6 address of cisco.com it is necessary to add a type to the command structure. The
syntax to instruct Dig to query a specific record type is dig [hostname] [record type].
┌──(kali㉿Kali)-[~]
└─$ dig cisco.com AAAA
┌──(kali㉿Kali)-[~]
└─$ dig cisco.com 8.8.8.8 ns
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 512
;; QUESTION SECTION:
;cisco.com. IN NS
;; ANSWER SECTION:
cisco.com. 1493 IN NS ns3.cisco.com.
cisco.com. 1493 IN NS ns1.cisco.com.
cisco.com. 1493 IN NS ns2.cisco.com.
© 2023 - 2025 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 6 of 8
Lab - DNS Lookups
┌──(kali㉿Kali)-[~]
└─$ dig skillsforall.com any
Compare the output of the dig tool with the output of nslookup for any record type. Which output is easier
to read to obtain the values contained in the various record types?
<Type your answer here>
┌──(kali㉿Kali)-[~]
└─$ dig -x 72.163.5.201
What type of record is returned with the host name?
<Type your answer here>
b. Use the dig -x command to query for another IP address in the same subnet.
┌──(kali㉿Kali)-[~]
└─$ dig -x 72.163.1.1
Examine the output returned from the dig command. What type of device do you think is assigned the
72.163.1.1 address?
<Type your answer here>
┌──(kali㉿Kali)-[~]
└─$ host 72.163.10.1
b. Host can also be used to perform a quick IP address lookup for a known hostname.
┌──(kali㉿Kali)-[~]
└─$ host hsrp-72-163-10-1.cisco.com
How does the output of the host command differ from dig or nslookup when querying for an IP address
assigned to a known host?
<Type your answer here>
c. URLs often contain aliases for the host name of the server hosting the website. The output of the host
command can list the servers that respond to that URL.
┌──(kali㉿Kali)-[~]
└─$ host www.cisco.com
© 2023 - 2025 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 7 of 8
Lab - DNS Lookups
The information about aliases is useful when trying to determine where the actual website or service is
located.
┌──(kali㉿Kali)-[~]
└─$ nslookup 72.163.5.201
To use interactive mode, enter nslookup with no options. At the > prompt, enter the target IP address.
┌──(kali㉿Kali)-[~]
└─$ nslookup
> 72.163.5.201
Reflection
In this lab, you used nslookup, dig, and host to obtain information from DNS zone files. Which tool would you
use to begin a passive reconnaissance effort against a targeted domain? Why?
<Type your answer here>
© 2023 - 2025 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 8 of 8