简单粗暴的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会将代码中的半角引号变成全角,请自行修改后食用
重启后生效
阅读剩余
版权声明:
作者:John
链接:https://vps.la/2021/10/03/%e7%ae%80%e5%8d%95%e7%b2%97%e6%9a%b4%e7%9a%84ubuntu%e6%b7%bb%e5%8a%a0dns%e6%96%b9%e6%b3%95%ef%bc%8c%e6%b0%b8%e4%b9%85%e6%9c%89%e6%95%88%e7%9a%84%e9%82%a3%e7%a7%8d/
文章版权归作者所有,未经允许请勿转载。
THE END