DNS inquiring with dig

This note is about command line tool dig for DNS testing and information gathering.

First of all we must install dig

# for Arch Linux
yaourt -S dnsutils

# for Ubuntu
sudo apt-get install dnsutils

The default query is for Internet Address (A)

dig proft.me

Query for TXT (text annotations), short answer

dig -t TXT proft.me +short

Query for MX (mail exchanges)

dig -t MX proft.me

Query for NS (name servers)

dig -t NS proft.me

View all DNS records types

dig -t ANY proft.me

Get all root DNS servers

dig -t NS .

Watching full trace for DNS query

dig proft.me +trace

Reverse lookup

dig -x 91.235.128.229

Use another DNS server for query

dig @8.8.8.8 proft.me

Bulk lookup

dig -f ~/temp/domains.txt

cat ~/temp/domains.txt
proft.me
google.com
yandex.ru

Grabbing SOA information

dig proft.me +nssearch
comments powered by Disqus