For our Blog Visitor only Get Additional 3 Month Free + 10% OFF on TriAnnual Plan YSBLOG10
Grab the Deal

Nslookup Commands {User Guide}

Nslookup commands are command-line tools used to query Domain Name System (DNS) records and troubleshoot domain-related issues on Windows, macOS, and Linux systems. These commands allow administrators and developers to check DNS configurations such as A, MX, TXT, CNAME, and NS records to ensure that domains resolve correctly to their hosting servers or mail servers.

Nslookup can be run in both non-interactive mode for single queries and interactive mode for multiple DNS lookups within one session. It is essential for diagnosing website downtime, incorrect DNS mappings, mail delivery failures, DNS propagation delays, and cybersecurity incidents like DNS hijacking.

Nslookup supports specifying custom DNS resolvers, debug modes, timeout options, and reverse DNS lookups for retrieving hostnames from IP addresses, making it one of the most powerful DNS diagnostic tools available.

Why Nslookup Matters

Every website and online service depends on DNS to translate domain names into server IP addresses. When DNS fails, services go offline. Nslookup helps network administrators, hosting users, and developers verify whether DNS records are properly set up and resolving globally.

Why Nslookup Matters

It is a universal tool installed by default in most operating systems, requiring no additional software to perform accurate DNS checks instantly.

What Is Nslookup?

Nslookup (Name Server Lookup) is a command-line utility used for querying DNS servers to find domain, subdomain, and email-hosting information. It enables both basic and advanced diagnostics, such as checking DNS propagation, validating SPF/TXT records for email authentication, and analyzing connection issues.

Supported Platforms:

  • Windows Command Prompt or PowerShell
  • macOS Terminal
  • Linux Terminal

Uses:

  • Domain resolution verification
  • Email DNS validation (MX, SPF, DKIM via TXT)
  • Reverse lookup for IP to domain mapping
  • DNS security diagnostics

How Nslookup Works

  1. You enter a domain command
  2. The system sends a DNS query to a resolver (usually ISP or configured DNS)
  3. The resolver replies with the requested DNS record

It supports:

  • Recursive and authoritative DNS lookups
  • IPv4 and IPv6 record queries

Nslookup Syntax

The basic syntax format:

nslookup [domain] [DNS server]

Example:

nslookup youstable.com 8.8.8.8

Modes:

  • Non-interactive: Single command for quick lookups
  • Interactive: Allows multiple DNS queries inside nslookup console

Enter interactive mode:

nslookup

Most Used Nslookup Commands and Practical Examples

A Record Lookup (Domain to IP)

nslookup example.com

MX Record Lookup (Mail Server Check)

nslookup -type=MX example.com

NS Record Lookup (Name Servers)

nslookup -type=NS example.com

TXT Record Lookup (SPF, DKIM, Verification)

nslookup -type=TXT example.com

SOA Record Lookup (Primary DNS Authority)

nslookup -type=SOA example.com

CNAME Lookup (Alias Records)

nslookup -type=CNAME www.example.com

Reverse DNS Lookup (PTR Record)

Get hostname from IP:

nslookup 93.184.216.34

Advanced Nslookup Commands

Query Using a Specific DNS Server

nslookup example.com 1.1.1.1

Enable Debug Output

nslookup -debug example.com

Set Timeout

nslookup -timeout=10 example.com

IPv6 DNS Query

nslookup -query=AAAA example.com

Table: Nslookup Commands with Meaning and Example

CommandPurposeExample
nslookup example.comCheck A recordReturns IPv4 address
nslookup -type=MX domain.comEmail host checkMail server results
nslookup -type=NS domain.comName servers lookupDisplays authoritative NS
nslookup -type=TXT domain.comValidate SPF/TXTShows authentication records
nslookup -type=CNAME wwwAlias record checkwww to root-domain
nslookup -type=PTR IPReverse DNS lookupIP to domain mapping
nslookup -debug domain.comFull traceDNS query details

Real-World Troubleshooting Scenarios with Nslookup

ProblemDiagnosticInterpretation
Website not loadingCheck A recordWrong or missing IP
Emails bouncingCheck MX and SPFMisconfigured mail DNS
DNS propagation delaysQuery different DNS serversDifferences mean still updating
Suspicious trafficReverse lookup PTRIdentify hosting or attacker source

Nslookup vs Dig vs Host Commands

ToolBest Used ForOS
NslookupBasic to medium DNS checksWindows/macOS/Linux
DigAdvanced DNS & DNSSECLinux/macOS
HostSimple forward/reverse lookupsLinux/macOS

Nslookup remains widely used due to Microsoft ecosystem support.


Common Errors and Fixes

ErrorMeaningFix
NXDOMAINNo such domain existsCheck spelling or DNS creation
SERVFAILDNS server errorTry different DNS server
REFUSEDDNS rejected requestDNS may block outside access
TimeoutNo responseNetwork or firewall issue

Example Raw Output (Real Lookup)

nslookup youstable.com
Server:  8.8.8.8
Address: 8.8.8.8#53

Non-authoritative answer:
Name: youstable.com
Address: 104.21.xx.xx

Best Practices for Using Nslookup

  • Always verify from multiple DNS servers such as 1.1.1.1, 8.8.8.8
  • Check SPF, DKIM via TXT for email issues
  • Validate DNS changes after TTL expiration
  • Use debug for complex failures

What Is a Proper DNS Diagnostic Structure Using Nslookup?

Every DNS check should follow a structured flow:

  1. A record resolution
  2. NS record authority validation
  3. MX and TXT email configuration check
  4. SOA primary server confirmation
  5. Reverse DNS for IP verification

This ensures stability, deliverability, and security of hosted services.


FAQ’s – Nslookup

What is the purpose of nslookup?

To query DNS servers and diagnose domain resolution, email delivery, and network routing issues.

How do I check my DNS using nslookup?

Run:

nslookup yourdomain.com

Why does nslookup show different IP addresses?

Because DNS propagation or load balancing can serve multiple IPs.

How to test email DNS records using nslookup?

Check MX and TXT records:

nslookup -type=MX yourdomain.com
nslookup -type=TXT yourdomain.com

Is nslookup still supported?

Yes. While dig is more advanced on Unix-based systems, nslookup remains standard on Windows.

Prahlad Prajapati

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top