#!/bin/bash
# First Loop between 000 and 999
for a in `seq -s " " -w 000 999`
do
#Second loop between 000 and 999
for b in `seq -s " " -w 000 999`
do
#Using dig, try to retrieve the IP address (-t A) on the hostnames
CONTENT=`dig @1.1.1.1 -t A epdg.epc.mnc$a.mcc$b.pub.3gppnetwork.org`
#If we find "SOA" in the dig response, means that hostname has no associated IP address
if [[ $CONTENT =~ .*SOA.* ]]
then
echo "epdg.epc.mnc"$a".mcc"$b".pub.3gppnetwork.org" >> 3gpp_dead.txt
else
echo "epdg.epc.mnc"$a".mcc"$b".pub.3gppnetwork.org" >> 3gpp_alive.txt
fi
done
done
Hopefully this can be easily adjusted to cover many other ad-network.
Obviously the ad-network is able to enable/disable any subdomain not picked up today. In that case, you can decide to: