Hello,
I need to seperate multiple domains by having and not having A records.
I have created a shell script like below, but it is not working, as the $? is same (0) for both the dig commands that have and not have A records.
*************************
!/bin/bash
for dom in cat /home/xxxx/domainslist.txt
do
result= dig +noall +answer $dom
if [ "$result" != '') ];then
echo $dom >> /home/xxxx/havingA.txt
else
echo $dom >> /home/xxxx/havingNoA.txt
fi
done
**************************
Please help me if there is any other way we can do this. Thank you.