简单粗暴的Ubuntu添加DNS方法,永久有效的那种

简单粗暴上代码,直接复制粘贴运行即可:

apt-get install -y resolvconf
echo "TRUNCATE_NAMESERVER_LIST_AFTER_127=no">>/etc/default/resolvconf
cat /etc/default/resolvconf
echo "nameserver 8.8.8.8">>/etc/resolvconf/resolv.conf.d/base
echo "nameserver 8.8.4.4">>/etc/resolvconf/resolv.conf.d/base
cat /etc/resolvconf/resolv.conf.d/base
resolvconf -u

 

本文的添加的DNS是谷歌的8.8.8.8,8.8.4.4

注意,wordpress会将代码中的半角引号变成全角,请自行修改后食用

重启后生效

 

 

阅读剩余
THE END