当前位置:   article > 正文

ubuntu22.04系统更改完resolv.conf后 重启网络服务后resolv.conf被重置_ubuntu resolv重启就变

ubuntu resolv重启就变

  1. vi /etc/systemd/resolved.conf,
    1. [Resolve]
    2. DNS=8.8.8.8 114.114.114.114 192.168.4.2

    2.重启域名解析服务
    1. systemctl restart systemd-resolved
    2. systemctl enable systemd-resolved

    3.备份当前的/etc/resolve.conf,并重新设置/run/systemd/resolve/resolv.conf 到/etc/resolve.conf的软链接
    1. mv /etc/resolv.conf /etc/resolv.conf.bak
    2. ln -s /run/systemd/resolve/resolv.conf /etc/resolv.conf

    4.查看验证,
    cat /etc/resolv.conf
    1. apt update -y && sudo apt full-upgrade -y && apt autoremove -y

本文内容由网友自发贡献,转载请注明出处:https://www.wpsshop.cn/w/Monodyee/article/detail/579943
推荐阅读
相关标签
  

闽ICP备14008679号