美文网首页
ubuntu18 自带dns服务systemd-resolved

ubuntu18 自带dns服务systemd-resolved

作者: wowshiwoniu | 来源:发表于2020-10-15 16:35 被阅读0次

停掉自带的dns管理服务

systemctl stop systemd-resolved
systemctl disable systemd-resolved

删除dns配置文件

rm /etc/resolv.conf

重新写入dns解析

echo -e "nameserver 114.114.114.114" > /etc/resolv.conf

修改/etc/nsswitch.conf

这个文件不修改,无法连接外网

vi /etc/nsswitch.conf
修改 hosts 为 
hosts: files dns mymachines

相关文章

网友评论

      本文标题:ubuntu18 自带dns服务systemd-resolved

      本文链接:https://www.haomeiwen.com/subject/voropktx.html