简单粗暴的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

 

未经允许不得转载:VPS啦 » 简单粗暴的Ubuntu添加DNS方法,永久有效的那种

赞 (0) 打赏

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏