【问题标题】:Disable resolvconf permanently永久禁用 resolvconf
【发布时间】:2018-06-08 15:10:31
【问题描述】:

我想在 Ubuntu 16.04 中永久禁用 resolvconf。

现在我的 /etc/network/interfaces 包含

auto eth0
iface eth0 inet static
    address 192.168.43.175
    netmask 255.255.255.0
    network 192.168.43.0
    broadcast 192.168.43.255
    gateway 192.168.43.1
    # dns-* options are implemented by the resolvconf package, if installed
    dns-nameservers 192.168.43.240
    dns-search domain.local

只要网络服务启动,就用

配置 /etc/resolv.conf
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
#     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 192.168.43.240
search domain.local

我想要的是使用自定义名称服务器和域修改我的 /etc/resolv.conf,而无需修改我的 /etc/network/interfaces 并且在网络重启或操作系统重启后永久配置。

在网络重启后我设法使其永久化

resolvconf --disable-update

但是这个选项在操作系统重启后不是永久的。

【问题讨论】:

    标签: ubuntu ubuntu-16.04


    【解决方案1】:
    ~/# systemctl disable systemd-resolved.service
    ~/# service systemd-resolved stop
    

    编辑 /etc/NetworkManager/NetworkManager.conf 并将其添加到 [main](或更改它):

    dns=default
    

    然后:

    ~/# systemctl restart network-manager
    

    顺便说一句,为什么要默认设置这个?太烦人了,至少让 nm-connection-editor 上的 Manual 配置优先于此。

    【讨论】:

    • 这不能回答未安装 network-manager 和 systemd-resolved 的 Ubuntu Server 的问题。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2012-10-03
    • 2015-09-18
    • 2016-08-31
    • 1970-01-01
    • 2019-10-08
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多