如何使用 NetworkManager 在 Mint-18 上配置 dnsmasq?

如何使用 NetworkManager 在 Mint-18 上配置 dnsmasq?

我正在学习linux网络。我对配置文件位置感到非常困惑。我在网上看到的内容与我的机器设置不符。

我正在使用 Mint 18。我正在使用网络管理器和 dnsmasq。

dnsmasq 设置页面,他们提到 dnsmasq 可以在 中配置/etc/dnsmasq.conf。我没有这个文件...

然而,有一个/etc/dnsmasq.d/network-manager,也有一个/etc/NetworkManager/dnsmasq.d/

我认为(虽然我不知道),这/etc/NetworkManager/dnsmasq.d就是我应该放置配置文件的地方。这与 NetworkManager 有关吗plugins

如果是这样的话是什么/etc/dnsmasq.d?我应该把我的配置文件放在这里吗?

答案1

所以通过运行ps ax | grep dnsmasq我能够看到配置文件来自哪里以及当前使用的配置......

>ps ax | grep dnsmasq
 1273 ?        S      0:00 /usr/sbin/dnsmasq --no-resolv --keep-in-foreground --no-hosts --bind-interfaces --pid-file=/var/run/NetworkManager/dnsmasq.pid --listen-address=127.0.1.1 --cache-size=0 --conf-file=/dev/null --proxy-dnssec --enable-dbus=org.freedesktop.NetworkManager.dnsmasq --conf-dir=/etc/NetworkManager/dnsmasq.d

可以看出--conf-dir=/etc/NetworkManager/dnsmasq.d

答案2

在 Linux Mint 上,运行whereis dnsmasq指向其中/etc/dnsmasq.d有一个README文件,描述可以将配置文件添加到该目录以及如何更改默认配置目录:

# All files in this directory will be read by dnsmasq as 
# configuration files, except if their names end in 
# ".dpkg-dist",".dpkg-old" or ".dpkg-new"
#
# This can be changed by editing /etc/default/dnsmasq

相关内容