gpt4 book ai didi

ubuntu - 永久禁用 resolvconf

转载 作者:行者123 更新时间:2023-12-04 18:50:45 25 4
gpt4 key购买 nike

我想在 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

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

最佳答案

~/# systemctl disable systemd-resolved.service
~/# service systemd-resolved stop

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

然后:
~/# systemctl restart network-manager

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

关于ubuntu - 永久禁用 resolvconf,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50763604/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com