Skip to main content

Check and Troubleshoot DNS

Here are a collection of Windows Command Prompt commands for working with an troubleshooting DNS

ipconfig /displaydns

ipconfig /displaydns

image.png

Output of DNS Cache Explained

Output Description
Record Name This is the name that was queried for and resolved via a DNS request
Record Type

1 = A record for IPv4

5 = CNAME record

15 = MX record

16 = Text record

28 = AAAA record for IPV6

12 = PTR (pointer) record


These are just a few of the DNS resource types with their associated numbers.  For more check this Wikipedia article.

Time to Live The time in seconds after which the cached DNS entry will expire.
Data Length The data length refers to the size of the data stored in the cache for a particular domain name. This data can include information such as the IP address associated with the domain name, the time to live (TTL) for the record, and other details about the DNS query. The data length is typically measured in bytes, and is used by the DNS resolver to determine how much space to allocate for the record in its cache.
Section This is a header designating the 'Answer', which is what follows as the A (Host) Record
A (Host) Record This is the corresponding resolved IPv4 address for the domain name.

Adding the pipe with clip to the command copies the output to the clipboard and you can copy that into a text editor to make it easier to search and filter the results.

ipconfig /displaydns | clip

image.png

ipconfig /flushdns

ipconfig /flushdns

This command clears the DNS cache

image.png

nslookup <domain name>

nslookup <domain name>

image.png

You can add the DNS server you want to query to the end of the command.

nslookup <domain name> <dns server IP>

image.png

image.png

If there are specific DNS records like mail, text, or pointer records you can add type to the query.

nslookup -type=mx <domain name>

image.png

nslookup -type=txt <domain name>

image.png

nslookup -type=ptr <domain name>

image.png