June 6, 20169 yr So I have a need that I must validate the name servers for my external domains. I have been trying to come up with a bash script that would read an export of my external view from Infoblox and perform a dig against a public internet DNS server like google or openDNS and provide results in a CSV format. Ugly way is to first export External View DNS Domains to a txt file (for example ext_domains.txt) Next create digscript.sh and paste the following #!/bin/sh CMD=/usr/bin/dig CMDOPT=ns SRV=@8.8.8.8 OPTION1=+noall OPTION2=+answer for domain in `cat ${1}`; do echo $domain $CMD $CMDOPT $SRV $domain $OPTION1 $OPTION2 done You have to make the file executable. chmod 755 digscript.sh Now you can run: digscript.sh ext_domains.txt > digresults.txt Clean it up some by running sed '/^;/ d' < digresults.txt > digresultsout.txt Now you can open it via Excel with space delimiter
Create an account or sign in to comment