Documentation Index

Fetch the complete documentation index at: https://docs.serversaustralia.com.au/llms.txt

Use this file to discover all available pages before exploring further.

Using nslookup to test DNS propagation

Prev Next

Overview 

When making changes to DNS, there is always a period of doubt where the TTL hasn't expired and your changes haven't fully propagated.

There are a handful of tools online that can be used to detect how the propagation is going: https://www.whatsmydns.net/ is one of many sites designed specifically for that task.

However, there is a built-in command-line application in most operating systems (Windows, macOS, and Linux) that you can use to connect with external DNS servers and check what they are seeing when you query them about your domain.


The app is called 'nslookup', and to get to it, you must use the command line. 

NSlookup is an inbuilt Windows command that lets you check DNS records.

DNS = domain name system

NSlookup = name system lookup

The syntax for the command is:

nslookup [-option] [hostname or IP_address] [dns_server]


The option flag and dns_server are optional but can be used for more specific queries.

Using the -type option allows you to request different DNS record types, such as AAAA, MX, CNAME, TXT, and NS.

If no type is specified, nslookup will return the A record by default.

The first section will cover how to open the command prompt, followed by a few practical examples.


Opening command prompt 

You can do this by typing "cmd" in the start search box or by pressing the Windows key + "R", typing "cmd", and clicking "command prompt".


Using NSlookup

Basic example

Here is an example of a basic nslookup of 'google.com'. By default, it will retrieve the A record for that domain from your default DNS server. 

nslookup google.com


Getting specific record types

Here is an example of getting a TXT record for Google, using the -type flag

nslookup -type=txt google.com


Querying different DNS servers

Here is an example of how to query different DNS servers.

nslookup google.com 1.1.1.1


Reverse lookup

You can also look up the PTR records against IP addresses.

nslookup 8.8.8.8