DNS troubleshooting

DNS Troubleshooting – tools and commands

Your DNS is not working well, and you have no idea what is happening. It is time for DNS troubleshooting. There are plenty of options that could help you discover the DNS problem. We will show you the most popular and practical for your needs.

DNS basic knowledge

If you searched “DNS troubleshooting” you probably know what DNS is, so we will go directly to the business. You can check the types of DNS records. You can troubleshoot specific DNS record to see if there are problems with them. It is possible that the DNS records were not configured correctly.   

DNS Troubleshooting Tools

There are plenty of tools that you can use. The tools can be specific for Linux, Windows, or Mac OS, or they can be browser-based. Most of the tools that we will show you overlaps in functionality, and it will be your decision which one you would use in the future.

Check if the problem is not just in your device

Before you start with the DNS troubleshooting, check if the problem is only local. If you are trying to access your website, but you are getting this message “DNS_PROBE_FINISHED_NXDOMAIN” the problem might be in your device. We recently wrote a way to fix it. Go and read the article. 

Dig command

dig command example

Good tool for DNS troubleshooting. You can see all the DNS records. You can use it on Linux and Mac OS, but you can search for a port for Windows too. A typical dig command will show you an Authority Section. You can see if the DNS is pointing correctly.

Use it with +trace in dig +trace combination “dig +trace YOURDOMAIN” to see the whole route of your query. This way you can locate the exact problem.

Dns.computer

https://www.dns.computer

DNS.computer DNS Troubleshooting tool

This one is simple and easy to use browser-based lookup tool. You can perform DNS troubleshooting with it even from your cell phone. Check a domain and get a fast result about the name servers, response time, SOA records, and A records. You can see if a server is not responding or if it is responding too slow. It is missing different DNS records, but it is convenient for a quick check.

Traceroute

Traceroute command and its options

Traceroute

As the name suggests, this will be ideal for checking the entire route of a DNS query. You can use it on Windows as Tracert, Linux and Mac OS as traceroute. You can try it with a domain or IP address, and you will see a result with all the hops and response time.

NSLookup

10 most used Nslookup commands

Command line: $ nslookup -debug

NSLookup lets you check any type of DNS record. You can use it to see all the available DNS records, or you can look for a specific type like – A, AAAA, SOA, MX, NS. You can use it to troubleshoot a domain using a particular port too. 

Host command

host google.com DNS Troubleshooting

Host command is very similar to the NSLookup but available only on Linux. You have to write the commands in the Terminal, and you can see the different types of DNS records.

One thing that you can troubleshoot if you have problem with your emails are the TXT records. You can see if there is a SPF record. It is a TXT record that prevents spoofing and stops your outgoing emails from going directly into the spam folder.

Ping command

Ping Google DNS troubleshooting

You can use Ping command on Windows, Mac OS, and Linux. By using ping, you can see if the name server you want to reach, responds. You can also check the time of the response and the TTL.

If the domain that you are troubleshooting doesn’t respond, but the IP gives results, that there is a problem in the hostname resolution. Check if the DNS servers are pointing to the right direction. 

DNS Troubleshooting Conclusion

There are plenty of useful tools that you can use for DNS troubleshooting. Try all of these and find the right one for you and your problem. Many overlaps in functionality, but have some small differences that can help you in a specific case.

As you saw, there are utilities for every operating system so that you can find the problem easily. After you see where the problem is, it is easy to fix it.  

Linux host command, troubleshot your DNS

Today we will add one more handy DNS tool – host command on Linux. For the purpose, we will use the latest Linux Mint 19.1 (based on Ubuntu Linux). For those of you who are used to Windows, Linux host command is very similar to nslookup, but a bit more advanced. Host command replaced the nslookup on Linux-based operating systems.  You can use it to check different types of DNS records.

Host command syntax

If you want to see the syntax of the host command and the options that it has, you can simply write “host” and press “Enter.”

host [-aCdlnrsTwv] [-c class] [-N ndots] [-R number] [-t type] [-W time] [-m flag] [-4] [-6] hostname [server]

host command syntax

Host command Options

Here you can see all the available options. Whenever you forgot them, just write “host” in the Terminal.

options for the command

Host command examples

For all the cases we will use Google.com. You can change Google.com with your domain or whichever else domain that you are interested in. We will give you several examples that can be useful for your work.

Search for the IP address of the domain.

host google.com

You will get IPv4 and IPv6 results for the domain.

host google.com

SOA Record

See the Start of Authority records with this command.

host –C google.com

SOA record

Check the name servers of the domain

host –t ns google.com

It will display the name servers of the host. The –t, we use to specify the type of query.

host ns record

Check a particular name server

You want, for example, to review the ns1, so you type:

host google.com ns1.google.com

particular name server

 CNAME record

host –t cname mail.google.com

You can use it to find CNAME record

host cname

MX record

Check the incoming mail server with this query

host –n –t mx google.com

mx record host command

TXT Record

You can also check TXT records

host –t txt google.com

txt host command

Decide the Waiting time for a query

You can use –w to wait forever or –W and time in seconds to decide how long to wait for a reply.

host –T –W 10 google.com

select time for host command

Reverse lookup

You can also check the IP and see the host

host 216.58.194.142

reverse dns lookup with host command

Host command to see all of the DNS records for a domain

host –a google.com

You will get information about various types of records – NS, AAAA, MX, etc.

all records host command

Conclusion:

This was the host command. Now you have one more way to troubleshoot your DNS. If you are interested in DNS diagnostic we recommend you the following articles too: Dig command, Nslookup, Traceroute and Ping. They will expand your knowledge in DNS diagnostic.