Nslookup est un outils puissant d’administration réseau disponible sur tous les système d’exploitation qui permet d’interroger le serveur DNS afin d’obtenir des informations concernant les nom de domaine, adresses IP et d’autre enregistrement DNS. Dans ce guide nous allons découvrir les meilleurs commande nslookup les plus utilisées.
Si vous ne trouvez pas la commande nslookup il vous faudra installer le package bind-utils ( sous centos8 dans mon cas ):
[root@srv ~]# dnf install bind-utils
1- Trouver l’enregistrement A d’un domaine :
[root@srv ~]# nslookup google.com Server: 192.168.162.2 Address: 192.168.162.2#53 Non-authoritative answer: Name: google.com Address: 172.217.16.238 Name: google.com Address: 2a00:1450:4003:803::200e
2- Vérifier les enregistrements NS d’un domaine:
[root@srv ~]# nslookup -type=ns google.com Server: 192.168.162.2 Address: 192.168.162.2#53 Non-authoritative answer: google.com nameserver = ns1.google.com. google.com nameserver = ns3.google.com. google.com nameserver = ns4.google.com. google.com nameserver = ns2.google.com. Authoritative answers can be found from:
3- Vérifier l’enregistrement SOA d’un domain :
[root@srv ~]# nslookup -type=soa google.com Server: 192.168.162.2 Address: 192.168.162.2#53 Non-authoritative answer: google.com origin = ns1.google.com mail addr = dns-admin.google.com serial = 316854466 refresh = 900 retry = 900 expire = 1800 minimum = 60 Authoritative answers can be found from:
4-Trouver l’enregistrement MX :
[root@srv ~]# nslookup -query=mx google.com Server: 192.168.162.2 Address: 192.168.162.2#53 Non-authoritative answer: google.com mail exchanger = 10 aspmx.l.google.com. google.com mail exchanger = 40 alt3.aspmx.l.google.com. google.com mail exchanger = 50 alt4.aspmx.l.google.com. google.com mail exchanger = 20 alt1.aspmx.l.google.com. google.com mail exchanger = 30 alt2.aspmx.l.google.com. Authoritative answers can be found from:
5- Comment interroger un serveur DNS spécifique :
[root@srv ~]# nslookup google.com ns1.google.com Server: ns1.google.com Address: 216.239.32.10#53 Name: google.com Address: 172.217.16.238 Name: google.com Address: 2a00:1450:4003:803::200e
6-Afficher le Revers DNS :
[root@srv ~]# nslookup 172.217.16.238 238.16.217.172.in-addr.arpa name = mad08s04-in-f14.1e100.net. Authoritative answers can be found from:
7- Changer l’intervalle de timeoute :
[root@srv ~]# nslookup -timeout=20 google.com Server: 192.168.162.2 Address: 192.168.162.2#53 Non-authoritative answer: Name: google.com Address: 172.217.16.238 Name: google.com Address: 2a00:1450:4003:803::200e
8-Activer le mode debug :
[root@srv ~]# nslookup -debug google.com Server: 192.168.162.2 Address: 192.168.162.2#53 ------------ QUESTIONS: google.com, type = A, class = IN ANSWERS: -> google.com internet address = 172.217.16.238 ttl = 5 AUTHORITY RECORDS: ADDITIONAL RECORDS: ------------ Non-authoritative answer: Name: google.com Address: 172.217.16.238 ------------ QUESTIONS: google.com, type = AAAA, class = IN ANSWERS: -> google.com has AAAA address 2a00:1450:4003:803::200e ttl = 5 AUTHORITY RECORDS: ADDITIONAL RECORDS: ------------ Name: google.com Address: 2a00:1450:4003:803::200e
nmap : les 12 commandes que vous devez connaître
Protocole du routage
Netstat : Les 14 commandes les plus utilisées
Migration de CentOS 7 vers CentOS Stream
Fail2Ban : How to protect Linux services