DIG

Whenever I need to do something concerning DNS resolving I resort to dig.

Some examples:

Getting the IP adres for maboc.nl:

martijnmbos@penguin:~$ dig maboc.nl

; <<>> DiG 9.11.5-P4-5.1+deb10u3-Debian <<>> maboc.nl
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 51719
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;maboc.nl.                      IN      A

;; ANSWER SECTION:
maboc.nl.               182     IN      A       81.4.96.191

;; Query time: 11 msec
;; SERVER: 100.115.92.193#53(100.115.92.193)
;; WHEN: Thu Mar 11 16:46:59 CET 2021
;; MSG SIZE  rcvd: 53

martijnmbos@penguin:~$

Get The MX record for this domain:

martijnmbos@penguin:~$ dig maboc.nl mx

; <<>> DiG 9.11.5-P4-5.1+deb10u3-Debian <<>> maboc.nl mx
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 43351
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;maboc.nl.                      IN      MX

;; ANSWER SECTION:
maboc.nl.               300     IN      MX      10 mail.maboc.nl.

;; Query time: 24 msec
;; SERVER: 100.115.92.193#53(100.115.92.193)
;; WHEN: Thu Mar 11 16:51:09 CET 2021
;; MSG SIZE  rcvd: 58

martijnmbos@penguin:~$

Getting the txt record:

martijnmbos@penguin:~$ dig _acme-challenge.maboc.nl txt

; <<>> DiG 9.11.5-P4-5.1+deb10u3-Debian <<>> _acme-challenge.maboc.nl txt
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 20401
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;_acme-challenge.maboc.nl.      IN      TXT

;; ANSWER SECTION:
_acme-challenge.maboc.nl. 287   IN      TXT     "XwDV1MQVDuhgUyAviZKhnFJNG9_rNVBURQ85IWpN-MQ"

;; Query time: 13 msec
;; SERVER: 100.115.92.193#53(100.115.92.193)
;; WHEN: Thu Mar 11 16:54:34 CET 2021
;; MSG SIZE  rcvd: 109

martijnmbos@penguin:~$

Reverse lookup:

martijnmbos@penguin:~$ dig -x 81.4.96.191

; <<>> DiG 9.11.5-P4-5.1+deb10u3-Debian <<>> -x 81.4.96.191
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 11732
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;191.96.4.81.in-addr.arpa.      IN      PTR

;; ANSWER SECTION:
191.96.4.81.in-addr.arpa. 51397 IN      PTR     srv12247.hostingserver.nl.

;; Query time: 77 msec
;; SERVER: 100.115.92.193#53(100.115.92.193)
;; WHEN: Thu Mar 11 16:55:37 CET 2021
;; MSG SIZE  rcvd: 92

martijnmbos@penguin:~$

Leave a Reply

Your email address will not be published. Required fields are marked *