Skip to content

Instantly share code, notes, and snippets.

@zunda
Last active January 25, 2023 19:14
Show Gist options
  • Save zunda/0dcc1001ec404eb7ca00b260a55d4c52 to your computer and use it in GitHub Desktop.
Save zunda/0dcc1001ec404eb7ca00b260a55d4c52 to your computer and use it in GitHub Desktop.
某DNSプロパイダインスパイアの金盾確認コマンド
#!/bin/sh
#
# usage: value-domain example.com
#
# tests if the domain is blocked by the great firewall
#
# Copyright 2022 zunda <zundan at gmail.com>
#
# Permission is granted for use, copying, modification, distribution,
# and distribution of modified versions of this work as long as the
# above copyright notice is included.
#
if [ -z "$1" ]; then
echo usage: value-domain example.com
exit 1
fi
if dig @8.8.8.8 +timeout=1 $1 > /dev/null 2>&1;
then
if dig @123.123.123.1 +timeout=1 $1 > /dev/null 2>&1;
then
echo blocked
else
echo not blocked
fi
else
echo not exist
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment