Ubuntu22.04修改dns |
您所在的位置:网站首页 › 如何修改dns为114 › Ubuntu22.04修改dns |
systemd-resolved 服务是用来提供本机应用软件与DNS 解析服务的,其包含解析主机名称、IP 地址、域名、DNS 资源记录等,Ubuntu修改DNS就需要通过此服务来完成! 问题通常我们知道,修改dns的几个途径 /etc/resolv.conf /etc/netplan/01-netcfg.yaml修改上面两个文件,一般情况下,可以解决,但是在一次使用新安装的ubuntu22.04的时候,发现,无论怎么修改,dig解析域名都是往127.0.0.53发送,哪怕在缓存中的已经生效 如何查看缓存中生效的配置呢 cat /run/systemd/resolve/resolv.conf 解决方法需要删掉或者修改 /etc/resolv.conf 文件名 先修改dns配置 vim /etc/systemd/resolved.conf [Resolve] DNS=223.6.6.6 114.114.114.114删除或者修改文件名 mv /etc/resolv.conf /etc/resolv.conf.bak将 /etc/systemd/resolved.conf 新建快捷方式为 /etc/resolv.conf ln -s /run/systemd/resolve/resolv.conf /etc/最后重启网络 systemctl restart systemd-resolved systemctl restart NetworkManager本文来自博客园,作者:厚礼蝎,转载请注明原文链接:https://www.cnblogs.com/guangdelw/p/17493919.html |
今日新闻 |
推荐新闻 |
CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3 |