A more useful dig
The default output from dig
is pretty cluttered and doesn’t include all relevant information:
➜ dig chopmo.dk
; <<>> DiG 9.8.3-P1 <<>> chopmo.dk
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 64377
;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 0
;; QUESTION SECTION:
;chopmo.dk. IN A
;; ANSWER SECTION:
chopmo.dk. 3413 IN A 192.30.252.153
chopmo.dk. 3413 IN A 192.30.252.154
;; Query time: 142 msec
;; SERVER: 192.168.1.3#53(192.168.1.3)
;; WHEN: Fri Dec 5 15:37:12 2014
;; MSG SIZE rcvd: 59
What I usually want is
- Information about all record types
- Only the
ANSWER
section - To ask Google’s 8.8.8.8 DNS service
I can get this by adding some options to dig
:
➜ dig ANY +noall +answer @8.8.8.8 chopmo.dk
chopmo.dk. 21164 IN MX 10 chopmo.dk.
chopmo.dk. 21164 IN NS ns1.gratisdns.dk.
chopmo.dk. 21164 IN NS ns2.gratisdns.dk.
chopmo.dk. 21164 IN NS ns3.gratisdns.dk.
chopmo.dk. 21164 IN NS ns4.gratisdns.dk.
chopmo.dk. 21164 IN NS ns5.gratisdns.dk.
chopmo.dk. 21164 IN SOA ns1.gratisdns.dk. chopmo.gmail.com. 2014100601 10800 3600 2419000 43200
chopmo.dk. 21164 IN TXT "keybase-site-verification=d6tm8MiGvnBjtWQCJpBuXoD7R_C6UPCxKmA_DCMzdhk"
chopmo.dk. 3164 IN A 192.30.252.153
chopmo.dk. 3164 IN A 192.30.252.154
Since I always want these options to be used, I add them to my ~/.digrc
:
➜ cat ~/.digrc
ANY +noall +answer @8.8.8.8