Skip to content

Instantly share code, notes, and snippets.

@rampageX
Last active November 25, 2016 18:30
Show Gist options
  • Save rampageX/8db695a5d5b8574630867ffd0ef4d15d to your computer and use it in GitHub Desktop.
Save rampageX/8db695a5d5b8574630867ffd0ef4d15d to your computer and use it in GitHub Desktop.
#! /bin/sh
gfwlist="/opt/etc/domain_gfwlist.txt"
polluted_domain="/opt/etc/polluted_domain.txt"
while read host; do
dig +trace +tries=1 +time=1 $host
if [ $(dig +trace +tries=1 +time=1 $host | wc -l) -eq 21 ]; then
echo $host >> $polluted_domain
fi
done < $gfwlist
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment