dnsverify
Created mardi 09 février 2016
Dns_verify permet de vérifier si tout les enregistrements ont bien une correspondance.
1 ####~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~### 2 ###------------------------dns_verify.sh-----------------------------### 3 ###__________________________________________________________________### 4 ###-----Modifier les adresses en fonction de son propre réseau-------### 5 ###-----Ajouter plusieurs réseaux séparés par une virgule ,----------### 6 ###-----juste à la première ligne: 172.25.3 correspond à mon lan-----### 7 ###---------------------ordinatous.com-------------------------------### 8 NETS="172.25.3" 9 IPS=$(seq 1 254) ## for Linux 10 # 11 # IPS=$(jot 254 1) ## for OpenBSD or FreeBSD 12 # IPS=$(seq 1 254) ## for Linux 13 # 14 echo 15 echo -e "\tip -> hostname -> ip" 16 echo '--------------------------------------------------------' 17 for NET in $NETS; do 18 for n in $(seq 1 254); do 19 A=${NET}.${n} 20 HOST=$(dig -x $A +short) 21 if test -n "$HOST"; then 22 ADDR=$(dig $HOST +short) 23 if test "$A" = "$ADDR"; then 24 echo -e "ok\t$A -> $HOST -> $ADDR" 25 elif test -n "$ADDR"; then 26 echo -e "fail\t$A -> $HOST -> $ADDR" 27 else 28 echo -e "fail\t$A -> $HOST -> [unassigned]" 29 fi 30 fi 31 done 32 done 33 34 echo "" 35 echo "DONE."
./dns_verify.sh
ip -> hostname -> ip
--------------------------------------------------------fail 172.25.3.4 -> mail.grp3.info-msj.net. -> 172.25.3.38
ok 172.25.3.29 -> bart.grp3.info-msj.net. -> 172.25.3.29
ok 172.25.3.30 -> postfix.grp3.info-msj.net. -> 172.25.3.30
ok 172.25.3.38 -> zimbuntu.grp3.info-msj.net. -> 172.25.3.38
fail 172.25.3.100 -> www.grp3.info-msj.net. -> 172.25.3.107
fail 172.25.3.104 -> serveur0.grp3.info-msj.net. -> [unassigned]
fail 172.25.3.105 -> serveur-ubuntu.grp3.info-msj.net. -> [unassigned]
ok 172.25.3.106 -> srvxy.grp3.info-msj.net. -> 172.25.3.106
ok 172.25.3.107 -> srv-debian.grp3.info-msj.net. -> 172.25.3.107
fail 172.25.3.108 -> serveur-ubuntu2.grp3.info-msj.net. -> [unassigned]
ok 172.25.3.113 -> rtfm.grp3.info-msj.net. -> 172.25.3.113
ok 172.25.3.123 -> www3.grp3.info-msj.net. -> 172.25.3.123
DONE.
xtbushido@srv-debian:~$ ./dns_verify.sh
ip -> hostname -> ip
--------------------------------------------------------ok 172.25.3.29 -> bart.grp3.info-msj.net. -> 172.25.3.29
ok 172.25.3.30 -> postfix.grp3.info-msj.net. -> 172.25.3.30
ok 172.25.3.38 -> zimbuntu.grp3.info-msj.net. -> 172.25.3.38
ok 172.25.3.106 -> srvxy.grp3.info-msj.net. -> 172.25.3.106
fail 172.25.3.107 -> srv-debian.grp3.info-msj.net.
www.grp3.info-msj.net. -> 172.25.3.107
172.25.3.107
ok 172.25.3.113 -> rtfm.grp3.info-msj.net. -> 172.25.3.113
ok 172.25.3.123 -> www3.grp3.info-msj.net. -> 172.25.3.123
DONE.
xtbushido@srv-debian:~$ ./dns_verify.sh
ip -> hostname -> ip
--------------------------------------------------------ok 172.25.3.29 -> bart.grp3.info-msj.net. -> 172.25.3.29
ok 172.25.3.30 -> postfix.grp3.info-msj.net. -> 172.25.3.30
ok 172.25.3.38 -> zimbuntu.grp3.info-msj.net. -> 172.25.3.38
ok 172.25.3.106 -> srvxy.grp3.info-msj.net. -> 172.25.3.106
ok 172.25.3.107 -> srv-debian.grp3.info-msj.net. -> 172.25.3.107
ok 172.25.3.113 -> rtfm.grp3.info-msj.net. -> 172.25.3.113
ok 172.25.3.123 -> www3.grp3.info-msj.net. -> 172.25.3.123
DONE.
Backlinks: Home:07) Script shell bash