Linux 未绑定为dns的NetworkManager

Linux 未绑定为dns的NetworkManager,linux,dns,archlinux,networkmanager,unbound,Linux,Dns,Archlinux,Networkmanager,Unbound,我在虚拟机上安装了archlinux,我使用NetworkManager处理我的连接。 在我尝试将NetworkManager用于dns切换为“未绑定”后,我似乎无法让它们一起运行。我按照指南上的“解除绑定” My/etc/unbound/unbound.conf看起来像: include: "/etc/unbound/resolvconf.conf" server: use-syslog: yes do-daemonize: no username: "unbound" directory:

我在虚拟机上安装了archlinux,我使用NetworkManager处理我的连接。 在我尝试将NetworkManager用于dns切换为“未绑定”后,我似乎无法让它们一起运行。我按照指南上的“解除绑定”

My/etc/unbound/unbound.conf看起来像:

include: "/etc/unbound/resolvconf.conf"
server: 
use-syslog: yes
do-daemonize: no
username: "unbound"
directory: "/etc/unbound"
trust-anchor-file: trusted-key.key

private-domain: "intranet"
private-domain: "internal"
private-domain: "private"
private-domain: "corp"
private-domain: "home"
private-domain: "lan"
unblock-lan-zones: yes
insecure-lan-zones: yes

domain-insecure: "intranet"
domain-insecure: "internal"
domain-insecure: "private"
domain-insecure: "corp"
domain-insecure: "home"
domain-insecure: "lan"

root-hints: root.hints
# Configuration for resolvconf(8)
# See resolvconf.conf(5) for details

resolv_conf=/etc/resolv.conf:

# If you run a local name server, you should uncomment the below line and
# configure your subscribers configuration files below.
name_servers="::1 127.0.0.1"
private_interfaces="*"

# Write out unbound configuration file
unbound_conf=/etc/unbound/resolvconf.conf
我的/etc/resolvconf.conf如下所示:

include: "/etc/unbound/resolvconf.conf"
server: 
use-syslog: yes
do-daemonize: no
username: "unbound"
directory: "/etc/unbound"
trust-anchor-file: trusted-key.key

private-domain: "intranet"
private-domain: "internal"
private-domain: "private"
private-domain: "corp"
private-domain: "home"
private-domain: "lan"
unblock-lan-zones: yes
insecure-lan-zones: yes

domain-insecure: "intranet"
domain-insecure: "internal"
domain-insecure: "private"
domain-insecure: "corp"
domain-insecure: "home"
domain-insecure: "lan"

root-hints: root.hints
# Configuration for resolvconf(8)
# See resolvconf.conf(5) for details

resolv_conf=/etc/resolv.conf:

# If you run a local name server, you should uncomment the below line and
# configure your subscribers configuration files below.
name_servers="::1 127.0.0.1"
private_interfaces="*"

# Write out unbound configuration file
unbound_conf=/etc/unbound/resolvconf.conf
在使用resolvconf-u生成新的resolv.conf之后,/etc/resolv.conf如下所示:

# Generated by resolvconf
nameserver ::1
nameserver 127.0.0.1
在检查systemctl status unbound后,显示unbound处于活动状态并正在运行。 重新启动后,NetworkManager仍在生成resolv.conf并从resolvconf-u命令中重置该文件。因此,在进行了一些搜索之后,我发现我应该在/etc/NetworkManager/NetworkManager.conf中设置dns=unbound,从一开始,我只需去掉顶部的注释行,并添加了[main]和dns=unbound字段:

# Configuration file for NetworkManager.
# See "man 5 NetworkManager.conf" for details.
[main]
dns=unbound
现在重新启动后/etc/resolv.conf不会被networkmanager重置,但我没有任何internet连接和系统CTL状态networkmanager 表示启动失败:

NetworkManager.service: Main process exited, code=exited, status=1/FAILURE
NetworkManager.service: Failed with result 'exit-code'.
Failed to start Network Manager.
NetworkManager.service: Service RestartSec=100ms expired, scheduling restart.

我真的不明白问题出在哪里,根据我的理解,在NetworkManager中使用“unbound”作为dns应该是相当直接的。

我似乎通过不将NetworkManager.conf设置为

[main]
dns=unbound
而是将其设置为:

[main]
dns=none
现在,重新启动后,networkmanager不会重置resolv.conf,我也有internet连接