What is nslookup

Last updated: April 1, 2026

Quick Answer: nslookup is a command-line tool used to query Domain Name System (DNS) servers and resolve domain names to IP addresses for network troubleshooting.

Key Facts

Overview

nslookup is a fundamental network diagnostic utility that enables users to query DNS servers directly from the command line. It retrieves information about internet domain names and their corresponding IP addresses, making it essential for network troubleshooting, website administration, and IT maintenance tasks. The tool was originally developed as part of the BIND (Berkeley Internet Name Domain) DNS software package.

How nslookup Works

When you enter a domain name query, nslookup contacts a DNS server and retrieves the associated records. It translates human-readable domain names (like example.com) into IP addresses (like 192.0.2.1) that computers use to communicate. The tool can query your default DNS server or specify a particular DNS server to interrogate.

DNS Record Types

nslookup can retrieve various DNS record types: A records map domain names to IPv4 addresses, AAAA records map to IPv6 addresses, MX records identify mail servers for a domain, CNAME records create domain aliases, TXT records store text information like SPF data, and SOA records contain zone authority information.

Basic Usage

In non-interactive mode, you simply type 'nslookup domain.com' to get basic information. Interactive mode, started by typing 'nslookup' without arguments, allows multiple queries without restarting the tool. Users can change DNS servers, modify query settings, and perform complex lookups without exiting the interactive session.

Troubleshooting DNS Issues

Network administrators use nslookup to diagnose DNS-related problems such as domain resolution failures, email delivery issues, and DNS server misconfiguration. By querying different DNS servers, administrators can identify whether problems originate from local DNS caches, ISP nameservers, or authoritative nameservers.

Modern Alternatives

While nslookup remains functional, modern Unix-like systems prefer 'dig' (Domain Information Groper) and 'host' commands for more detailed output and better formatting. However, nslookup's simplicity and availability across all major operating systems make it still valuable for quick queries and basic DNS troubleshooting.

Related Questions

What is the difference between nslookup and dig?

Both tools query DNS servers, but dig provides more detailed output and is preferred on Unix-like systems. nslookup offers simpler syntax and works cross-platform, making it ideal for quick lookups and Windows users.

How do I use nslookup to check DNS records?

Type 'nslookup domain.com' for basic A records, or 'nslookup -type=MX domain.com' to check specific record types. Enter interactive mode by typing 'nslookup' alone, then use set commands to configure queries.

Why would DNS lookups fail?

DNS failures can result from incorrect DNS server settings, network connectivity issues, domain name misconfigurations, or DNS server outages. Use nslookup to test different nameservers and diagnose the exact failure point.

Sources

  1. Wikipedia - nslookup CC-BY-SA-4.0
  2. ISC BIND - Official DNS Software Various