Skip to content

Instantly share code, notes, and snippets.

@jnorthrup
Last active September 25, 2019 05:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jnorthrup/d48bdfe5c02fc9decce254fca9ca1417 to your computer and use it in GitHub Desktop.
Save jnorthrup/d48bdfe5c02fc9decce254fca9ca1417 to your computer and use it in GitHub Desktop.
Indonesian reddit DNS script
#use google dns webservice
#as root
for i in $@
do
eval echo $(
curl -s 'https://dns.google.com/resolve?name='${i[@]}'&type=A'|
jq -S '.Answer[-1].data'
) $i |
grep -v null |
tee -a /etc/hosts
done
#use google dns service
#as root
for i in $@
do x=( $( nslookup $i 8.8.8.8 ) )
echo ${x[-1]} ${i}
done >>/etc/hosts
#as root, using vpn
./gdns about.reddit.com a.thumbs.redditmedia.com b.thumbs.redditmedia.com events.reddit.com gateway.reddit.com g.redditmedia.com i.redd.it i.redditmedia.com new.reddit.com oauth.reddit.com old.reddit.com out.reddit.com pixel.redditmedia.com reddit.com redditgifts.com sendbird.reddit.com stats.redditmedia.com v.redd.it www.reddit.com www.reddithelp.com www.redditmedia.com www.redditstatic.com
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment