Linux 服务器 更换DNS - Hello World

Linux 服务器 更换DNS

1.更换为 国内DNS

echo -e "options timeout:1 attempts:1 rotate\nnameserver 119.29.29.29\nnameserver 114.114.114.114">/etc/resolv.conf;

2.更换为 国外DNS

echo -e "options timeout:1 attempts:1 rotate\nnameserver 8.8.8.8\nnameserver 8.8.4.4" >/etc/resolv.conf;

3.更换为 国内外并行的DNS配置

echo -e "options timeout:1 attempts:1 rotate\nnameserver 114.114.114.114\nnameserver 8.8.8.8" >/etc/resolv.conf;

查看 当前DNS配置

cat /etc/resolv.conf