mirror of
https://github.com/QSCTech/zjunet.git
synced 2026-01-22 19:54:48 +08:00
add dns.sh
This commit is contained in:
parent
b6a2f0fd33
commit
182ac5ffce
23
dns.sh
Normal file
23
dns.sh
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
##################################
|
||||||
|
#
|
||||||
|
# DNS Helper
|
||||||
|
#
|
||||||
|
##################################
|
||||||
|
|
||||||
|
function 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
|
||||||
Loading…
x
Reference in New Issue
Block a user