dns/test-utility.sh

40 lines
954 B
Bash
Raw Normal View History

2019-07-18 20:23:58 +00:00
#!/usr/bin/env bash
function test {
2019-07-18 21:12:07 +00:00
SUFFIX="dns.nixnet.xyz"
2019-07-18 20:23:58 +00:00
2019-07-18 21:12:07 +00:00
SERVER="$1.$SUFFIX"
2019-07-18 20:23:58 +00:00
2019-07-18 21:12:07 +00:00
SERVER4=$(dig -t A +short $SERVER | grep -v "xyz")
SERVER6=$(dig -t AAAA +short $SERVER | grep -v "xyz")
2019-07-18 20:23:58 +00:00
2019-07-18 21:12:07 +00:00
echo "TRYING IPv4 $SERVER (DNS-over-TLS, $SERVER4)"
IP4_ADDR="$(kdig @$SERVER4 +noall +short +tls-ca +tls-host=$SERVER +tls-sni=$SERVER -t A whoami.v4.powerdns.org)"
2019-07-21 00:23:47 +00:00
echo "$IP4_ADDR ($(dig +short -x $IP4_ADDR 2>/dev/null))"
2019-07-18 21:12:07 +00:00
echo "TRYING IPv6 $SERVER (DNS-over-TLS, $SERVER6)"
IP6_ADDR="$(kdig @$SERVER6 +noall +short +tls-ca +tls-host=$SERVER +tls-sni=$SERVER -t AAAA whoami.v6.powerdns.org)"
2019-07-21 00:23:47 +00:00
echo "$IP6_ADDR ($(dig +short -x $IP6_ADDR 2>/dev/null))"
2019-07-18 21:12:07 +00:00
echo ""
2019-07-18 20:23:58 +00:00
}
test "adblock.lv1"
test "adblock.lux1"
test "adblock.ny1"
2019-07-18 21:12:07 +00:00
echo ""
echo ""
2019-07-18 20:23:58 +00:00
test "uncensored.lv1"
test "uncensored.lux1"
test "uncensored.ny1"
2019-07-20 02:42:05 +00:00
echo ""
echo "Your nearest anycast instance is: $(curl -sS https://check.any.dns.nixnet.xyz/check)"
#test "adblock.any"
#test "uncensored.any"