1
0
mirror of https://github.com/QSCTech/zjunet.git synced 2026-01-22 11:44:48 +08:00
zjunet/dns.sh
2014-09-18 22:45:38 +08:00

26 lines
588 B
Bash
Executable File
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/bin/sh
##################################
#
# DNS Helper
#
##################################
zju_test_and_set_up_dns () {
until [ -z "$1" ]
do
dig baidu.com @$1 +time=1 > /dev/null && echo "$1 ... ok" && echo "nameserver $1" > /etc/resolv.conf && break
echo "$1 ... fail"
shift
done
}
# 浙大的DNS不是很稳定这里列了备用方案
# 官方 > 10.12.10.12 > Senorsen DNS > RQ Lab > ALI YUN
zju_test_and_set_up_dns \
10.10.0.21 10.10.0.22 10.10.0.23 \
10.12.10.12 \
10.76.8.111 \
10.202.68.222 \
223.5.5.5 223.6.6.6