Linux

nslookup-scan of IP-range/subnet

#!/bin/bash # nslookup-scan of IP-range # It’s possible to add more networks separated with space NETS=”192.168.0″ IPRange=”1 254″ for NET in $NETS; do for n in $(seq $IPRange); do ADDR=${NET}.${n} echo “${ADDR},`nslookup ${ADDR} | awk -F “=” ‘{ print $2 }’|sed ‘s/^[ t]*//’ | sed ‘/^$/d’ | |sed ‘s/.$//’`” done done Result 192.168.0.1,cba.infra.no 192.168.0.2,bca.infra.no 192.168.0.3,abc.infra.no […]

Read More