DNS inquiring with dig Linux 07.12.2013

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

Use another DNS server for query

dig @ proft.me

Bulk lookup

dig -f ~/temp/domains.txt

cat ~/temp/domains.txt

Grabbing SOA information

dig proft.me +nssearch