DNS Basics with nslookup

Learn DNS basics by exploring different types of records (i.e. A, AAAA, CNAME, TXT)

37 Participants 30 Minutes Beginner

In this lab, we will explore the power of nslookup, a versatile command-line tool used to query DNS (Domain Name System) servers and retrieve DNS-related information. Understanding nslookup commands is essential for diagnosing and troubleshooting network issues, as well as gaining insights into domain name resolution.



There are no specific prerequisites for this lab. However, a basic understanding of networking concepts and familiarity with the command-line interface may be helpful.



Understanding nslookup Basics:

nslookup is like a digital magnifying glass for DNS. It allows you to look up DNS information for a domain name, IP address, or other DNS-related queries. Let's explore some key concepts related to nslookup:


DNS Query Types:

nslookup can perform various types of DNS queries, including A (IPv4 address), AAAA (IPv6 address), MX (mail server), CNAME (canonical name), PTR (reverse DNS), and more. Each query type provides specific information about the domain or IP address in question.

Querying DNS Servers:

nslookup can be used to query both local DNS servers and remote DNS servers.This tool is essential for verifying DNS configuration and resolving domain names.

Interactive and Non-Interactive Mode:

nslookup can be run in interactive mode, allowing you to perform multiple queries without exiting the tool. It can also be used in non-interactive mode for single queries or scripted operations.

DNS Records and Responses:

When you perform an nslookup query, you receive responses containing DNS records, such as A records (IPv4 addresses), AAAA records (IPv6 addresses), and more. These responses provide valuable information about the domain's DNS configuration.


Benefits of nslookup:

nslookup offers several advantages:

1. Diagnosis and Troubleshooting: nslookup is a valuable tool for diagnosing DNS-related issues, such as incorrect DNS configurations, unreachable DNS servers, and DNS resolution problems.

2. Verification: You can use nslookup to verify DNS records, ensuring that domain names resolve to the correct IP addresses.

3. Network Planning: When setting up networks or configuring DNS servers, nslookup helps validate DNS settings and ensure smooth domain name resolution.


Common nslookup Commands:

Throughout this lab, we will explore common nslookup commands used to interact with DNS servers, including:

- `nslookup`: Start an interactive nslookup session or perform a single query.

- `set type`: Specify the query type (e.g., A, AAAA, MX).

- `server`: Change the DNS server being queried.

- `set debug`: Enable or disable debugging mode for detailed query information.

- `set querytype`: Set the query type (e.g., A, AAAA) for the current session.

- `set q=mx`: Set the query type to MX (mail exchange).

- `set q=cname`: Set the query type to CNAME (canonical name).

- `set q=ptr`: Set the query type to PTR (reverse DNS).

- `exit` or `quit`: Exit the nslookup session.


Follow these links to learn more about nslookup:

1. nslookup | Microsoft Learn



This lab delves into the fundamentals of nslookup, guiding you through essential operations and showcasing the power of this command-line tool for DNS-related queries and troubleshooting. nslookup serves as a diagnostic and investigative tool for DNS, allowing you to retrieve valuable information about domain names, IP addresses, and DNS configurations. Understanding nslookup commands will empower you to diagnose and resolve DNS issues effectively and gain insights into domain name resolution. Let's dive into the lab to gain practical experience with nslookup.

DNS Basics with nslookup


Have a doubt? Got stuck somewhere?



Related Labs


Bus vs Hybrid Topology

Computer Networking

  • 30 m
  • Beginner
  • 134
Learn and compare Bus and Hybrid networking topology.

Cyclic Redundancy Check

Computer Networking

  • 30 m
  • Beginner
  • 142
Learn what is cyclic redundancy check (CRC), how it is calculated and calculate it on a simulation

ARP Basics

Computer Networking

  • 30 m
  • Beginner
  • 117
Learn what is ARP and how it works in Packet Tracer exercise

DNS Basics (Packet Tracer)

Computer Networking

  • 30 m
  • Beginner
  • 309
Learn how DNS queries work when a new website is opened on pre-built Packet Tracer setup