Linux - Troubleshooting with dns queries , Simple handy commands for DNS check

Troubleshooting with dns queries

check dns using dig or nslookup
 # dig w3calculator.com  

 # nslookup techbluff.com

Check the connectivity of a domain or by resolving the domain with DNS Server
 # nslookup myhostname <DNS-server-IP>

 # dig domainname.com @DNSServerIP

How to check NS and SOA
 # dig NS @<DNS-Server-IP> w3calculator.com

 # dig SOA @<DNS-Server-IP> w3calculator.com

 # sed '1 a nameserver 127.0.0.1' /etc/resolv.conf

Check the tcp connection
 # dig mydomainname NS +tcp +short

 # dig mydomainname NS +tcp

 # dig @192.168.12.6 mydomainname A

 # dig @192.168.12.6 mydomainname NS

For example if below command shows some error then it might be due to DNS down or error
 # dig @DNSServerIP -x IP-Address +short

Check reachablikity of DNS server
 # traceroute -T -p 53 DNS-SErver-IP

 # traceroute -U -p 53 DNS-SErver-IP

To check query log, check on DNS server
 # cd /var/log/named/que..log

The topic on Linux - Troubleshooting with dns queries is posted by - Vaish

Hope you have enjoyed, Linux - Troubleshooting with dns queries Thanks for your time

Tech Bluff