[gull] Comment obtenir les DNS?
Cédric Rochat
crochat at younics.org
Thu Nov 2 14:05:49 CET 2006
> (Un peu tard, je sais... mais j'etais absent la semaine passee)
Encore plus tard ;-)
Un petit script à deux balles, mais qui peut s'avérer utile :
/usr/local/bin/getDNS.sh
#!/bin/sh
# Description : Search for the DNS servers for a given domain name
# Author : Cédric Rochat <crochat at younics.org>
# Date : 14.09.2006
if [ "$1" != "" ]; then
DOMAIN=$1
echo "DNS servers for the domain \"$DOMAIN\":"
SERVERS=`host -t NS $DOMAIN|awk '{print $NF}'`
DNSNUMBER=1
for server in $SERVERS; do
ADDRESS=`host -t A $server|awk '{print $1" = "$NF}'`
echo " DNS$DNSNUMBER: $ADDRESS"
DNSNUMBER=$(expr $DNSNUMBER + 1)
done
else
echo "No domain passed... exiting !"
fi
exit 0
Ensuite, il suffit de faire "getDNS.sh google.com" pour obtenir les DNS de
Google ;-)
Voilà, j'espère que la mise en page ne va pas trop être massacrée !
Sinon, vous pouvez toujours me demander le script ;-)
++
--
********************************
Cédric Rochat
********************************
Rue des Fleurs 34
CH-2300 La Chaux-de-Fonds
priv: crochat at younics.org
crochat at phpmydvds.org
********************************
prof: cedric.rochat at he-arc.ch
crochat at jmburri.ch
********************************
homepage: http://www.younics.org
http://www.phpmydvds.org
http://www.jmburri.ch
********************************
More information about the gull
mailing list