Dig

Quelques petites options de dig histoire d’ouvrir la nouvelle catégorie “DNS/Bind”

  • Version de Bind
$ dig @ns-ext.isc.org. chaos txt version.bind +short  
"9.4.1-P1"  
$  
$ dig @ns-ext.isc.org. chaos txt authors.bind +short | head -2  
"Bob Halley"  
"David Lawrence"  
$  
$ dig @ns-ext.isc.org. chaos txt hostname.bind +short  
"ns-ext.pao1.isc.org"  
$
  • Transfert de zone
$ dig axfr @raff.debian.org. debian.org | head -10  

; <<>> DiG 9.3.4 <<>> axfr @raff.debian.org. debian.org  
; (1 server found)  
;; global options: printcmd  
debian.org. 3600 IN SOA samosa.debian.org. hostmaster.debian.org. 2007081601 10800 3600 604800 3600  
debian.org. 3600 IN A 192.25.206.10  
debian.org. 3600 IN MX 0 master.debian.org.  
debian.org. 3600 IN NS raff.debian.org.  
debian.org. 3600 IN NS rietz.debian.org.  
debian.org. 3600 IN NS klecker.debian.org.  
$
  • Suivre la chaîne de résolution +trace
$ dig www.isc.org +trace  

; <<>> DiG 9.3.4 <<>> www.isc.org +trace  
;; global options: printcmd  
. 3561749 IN NS d.root-servers.net.  
. 3561749 IN NS a.root-servers.net.  
. 3561749 IN NS l.root-servers.net.  
. 3561749 IN NS c.root-servers.net.  
. 3561749 IN NS m.root-servers.net.  
. 3561749 IN NS h.root-servers.net.  
. 3561749 IN NS f.root-servers.net.  
. 3561749 IN NS e.root-servers.net.  
. 3561749 IN NS j.root-servers.net.  
. 3561749 IN NS i.root-servers.net.  
. 3561749 IN NS g.root-servers.net.  
. 3561749 IN NS k.root-servers.net.  
. 3561749 IN NS b.root-servers.net.  
;; Received 436 bytes from 192.168.1.1#53(192.168.1.1) in 46 ms  

org. 172800 IN NS TLD3.ULTRADNS.org.  
org. 172800 IN NS TLD4.ULTRADNS.org.  
org. 172800 IN NS TLD5.ULTRADNS.INFO.  
org. 172800 IN NS TLD6.ULTRADNS.CO.UK.  
org. 172800 IN NS TLD1.ULTRADNS.NET.  
org. 172800 IN NS TLD2.ULTRADNS.NET.  
;; Received 343 bytes from 128.8.10.90#53(d.root-servers.net) in 123 ms  

isc.org. 86400 IN NS ns-ext.sth1.isc.org.  
isc.org. 86400 IN NS ns-ext.nrt1.isc.org.  
isc.org. 86400 IN NS ns-ext.lga1.isc.org.  
isc.org. 86400 IN NS ns-ext.isc.org.  
;; Received 192 bytes from 199.7.66.1#53(TLD3.ULTRADNS.org) in 126 ms  

www.isc.org. 600 IN A 204.152.184.88  
isc.org. 3600 IN NS ns-ext.isc.org.  
isc.org. 3600 IN NS ns-ext.lga1.isc.org.  
isc.org. 3600 IN NS ns-ext.nrt1.isc.org.  
isc.org. 3600 IN NS ns-ext.sth1.isc.org.  
;; Received 236 bytes from 192.228.89.19#53(ns-ext.sth1.isc.org) in 78 ms  
$
  • Nom associé à une IP
$ dig -x 204.152.184.88 +short
external.isc.org.
$
  • Requête itérative (non récursive)
$ dig mx isc.org @monserveurDNS +norec   

; <<>> DiG 9.3.4 <<>> mx isc.org @monserveurDNS +norec  
; (1 server found)  
;; global options: printcmd  
;; Got answer:  
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 48381  
;; flags: qr ra; QUERY: 1, ANSWER: 0, AUTHORITY: 6, ADDITIONAL: 6  

;; QUESTION SECTION:  
;isc.org. IN MX  

;; AUTHORITY SECTION:  
org. 59611 IN NS tld3.ultradns.org.  
org. 59611 IN NS tld4.ultradns.org.  
org. 59611 IN NS tld5.ultradns.info.  
org. 59611 IN NS tld6.ultradns.co.uk.  
org. 59611 IN NS tld1.ultradns.net.  
org. 59611 IN NS tld2.ultradns.net.  

;; ADDITIONAL SECTION:  
tld3.ultradns.org. 59611 IN A 199.7.66.1  
tld4.ultradns.org. 59611 IN A 199.7.67.1  
tld5.ultradns.info. 59611 IN A 192.100.59.11  
tld6.ultradns.co.uk. 59611 IN A 198.133.199.11  
tld1.ultradns.net. 59611 IN A 204.74.112.1  
tld2.ultradns.net. 59611 IN A 204.74.113.1  

;; Query time: 1 msec  
;; SERVER: monserveurDNS#53(monserveurDNS)  
;; WHEN: Wed Jan 01 01:01:01 2007  
;; MSG SIZE rcvd: 283  
  • La même requête récursive (par défaut)
$ dig mx isc.org @monserveurDNS  

; <<>> DiG 9.3.4 <<>> mx isc.org @monserveurDNS  
; (1 server found)  
;; global options: printcmd  
;; Got answer:  
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 25492  
;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 2  

;; QUESTION SECTION:  
;isc.org. IN MX  

;; ANSWER SECTION:  
isc.org. 3249 IN MX 10 mx.isc.org.  
isc.org. 3249 IN MX 15 mx.sth1.isc.org.  

;; ADDITIONAL SECTION:  
mx.isc.org. 3249 IN A 204.152.184.167  
mx.sth1.isc.org. 3249 IN A 192.228.89.21  

;; Query time: 5 msec  
;; SERVER: monserveurDNS#53(monserveurDNS)  
;; WHEN: Wed Jan 01 01:01:01 2007  
;; MSG SIZE rcvd: 100  
$
  • Simplifier la lecture des valeurs du SOA (+multiline)
$ dig soa isc.org. @ns-ext.isc.org. +multiline  
(extrait)  
isc.org. 3600 IN SOA ns-int.isc.org. hostmaster.isc.org. (  
2007090900 ; serial  
7200 ; refresh (2 hours)  
3600 ; retry (1 hour)  
24796800 ; expire (41 weeks)  
3600 ; minimum (1 hour)  
)  

Sinon c’est moins lisible

$ dig soa isc.org. @ns-ext.isc.org.  
(extrait)  
isc.org. 3600 IN SOA ns-int.isc.org. hostmaster.isc.org. 2007090900 7200 3600 24796800 3600  
Vus : 23
Publié par Uggy : 252