系统相关
首页 > 系统相关> > linux – 如果在主机上找到命名的bind9 / dnsmasq,则阻止resolvconf包分配localhost

linux – 如果在主机上找到命名的bind9 / dnsmasq,则阻止resolvconf包分配localhost

作者:互联网

Resolvconf是一个用于处理不同特定情况的软件包,例如具有dhcp,vpn的lans,以及其他每个人都尝试手动更改/etc/resolv.conf文件的情况.

它有一个算法,其中通过接口列表获得最大优先级,例如tun和dhcp客户端通过ppp连接.

的/ etc /需要resolvconf /接口阶

# interface-order(5)
lo.inet6
lo.inet
lo.@(dnsmasq|pdnsd)
lo.!(pdns|pdns-recursor)
lo
tun*
tap*
hso*
em+([0-9])?(_+([0-9]))*
p+([0-9])p+([0-9])?(_+([0-9]))*
eth*([^.]).inet6
eth*([^.]).ip6.@(dhclient|dhcpcd|pump|udhcpc)
eth*([^.]).inet
eth*([^.]).@(dhclient|dhcpcd|pump|udhcpc)
eth*
@(ath|wifi|wlan)*([^.]).inet6
@(ath|wifi|wlan)*([^.]).ip6.@(dhclient|dhcpcd|pump|udhcpc)
@(ath|wifi|wlan)*([^.]).inet
@(ath|wifi|wlan)*([^.]).@(dhclient|dhcpcd|pump|udhcpc)
@(ath|wifi|wlan)*
ppp*
*

我的问题是,如果你有resolvconf包,你也安装了像NAMED BIND9或DNSMASQ这样的DNS服务器,resolvconf软件会自动将最高优先级分配给127.0.0.1 ..

好吧,我不希望这样,我希望resolvconf包正常工作,好像没有安装bind9 / dnsmasq.但我找不到像resolvconf软件配置中的“忽略本地dns作为可能的dns选择”这样的选项.

解决方法:

很好看,经过一些尝试我找到了解决方案……

通过在interface-order文件中注释所有localhost行,特别是这两行:

# lo.@(dnsmasq|pdnsd)
# lo.!(pdns|pdns-recursor)

一切都按原样运作;)

标签:linux,resolvconf,bind9
来源: https://codeday.me/bug/20190815/1661766.html