-
Notifications
You must be signed in to change notification settings - Fork 1
DNS: dig et nslookup
Paspirine edited this page Feb 9, 2021
·
18 revisions
Le programme dig
permet d'interroger le DNS et est installé par défaut sous MacOS/Linux.
$dig www.google.ca
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 18486
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;www.google.ca. IN A
;; ANSWER SECTION:
www.google.ca. 98 IN A 172.217.13.131
;; Query time: 3 msec
;; SERVER: 192.168.0.1#53(192.168.0.1)
;; WHEN: Tue Feb 09 09:22:40 EST 2021
;; MSG SIZE rcvd: 58
$dig google.ca ns
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 18302
;; flags: qr rd ra; QUERY: 1, ANSWER: 4, AUTHORITY: 0, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;google.ca. IN NS
;; ANSWER SECTION:
google.ca. 345600 IN NS ns2.google.com.
google.ca. 345600 IN NS ns1.google.com.
google.ca. 345600 IN NS ns4.google.com.
google.ca. 345600 IN NS ns3.google.com.
;; Query time: 32 msec
;; SERVER: 192.168.0.1#53(192.168.0.1)
;; WHEN: Tue Feb 09 09:38:23 EST 2021
;; MSG SIZE rcvd: 120
$dig www.google.ca @ns1.google.com
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 4627
;; flags: qr aa rd; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1
;; WARNING: recursion requested but not available
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 512
;; QUESTION SECTION:
;www.google.ca. IN A
;; ANSWER SECTION:
www.google.ca. 300 IN A 172.217.13.99
;; Query time: 20 msec
;; SERVER: 216.239.32.10#53(216.239.32.10)
;; WHEN: Tue Feb 09 09:48:07 EST 2021
;; MSG SIZE rcvd: 58
Le programme nslookup
permet d'interroger le DNS et est installé par défaut sous Windows.
C:\> nslookup www.google.com
Server: mynetwork
Address: 192.168.0.1
Non-authoritative answer:
Name: www.google.com
Addresses: 2607:f8b0:4020:805::2004
172.217.13.100
C:\>nslookup -type=ns www.google.ca
Default Server: mynetwork
Address: 192.168.0.1
google.ca
primary name server = ns1.google.com
responsible mail addr = dns-admin.google.com
serial = 356224418
refresh = 900 (15 mins)
retry = 900 (15 mins)
expire = 1800 (30 mins)
default TTL = 60 (1 min)
C:\>nslookup www.google.ca ns1.google.com
Server: ns1.google.com
Address: 216.239.32.10
Name: www.google.ca
Addresses: 2607:f8b0:4020:805::2003
172.217.13.131