更新:看起来像它avahi-dnsconfd
说的增加8.8.8.8
和8.8.4.4
对我的/etc/resolv.conf
文件。我在/ var / log / syslog中找到了这个:
Jan 4 17:00:21 freewill nm-dispatcher: req:1 'up' [ens33]: start running ordered scripts...
Jan 4 17:00:21 freewill avahi-dnsconfd[3579]: New DNS Server 8.8.4.4 (interface: 2.IPv4)
Jan 4 17:00:21 freewill avahi-dnsconfd[3579]: New DNS Server 8.8.8.8 (interface: 2.IPv4)
我怎样才能让Ubuntu的从DHCP获取DNS服务器只和未使用的avahi(的mDNS)用于获取DNS服务器?
我正在测试Ubuntu Mate 16.04.1 LTS,并遇到了麻烦,因为某些事情不断将Google的DNS服务器添加到/etc/resolv.conf
:
josh@freewill:~$ cat /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 10.100.1.1
nameserver 8.8.4.4
nameserver 8.8.8.8
search my.domain.name
我不想8.8.4.4
,也不8.8.8.8
在/etc/resolv.conf
,因为这打破我的本地网络:我的本地DNS服务器(10.100.1.1)提供的DNS不具有公共DNS记录本地NAT的服务。
如果我手动编辑/etc/resolv.conf
并删除Google DNS名称服务器,则通过重新启动或重新添加它们resolvconf -u
NetworkManager在“其他DNS服务器”下没有列出8.8.8.8或8.8.4.4,因此不是原因。
系统具有三个以太网接口,仅连接了一个。它在具有提供DNS信息的DCHP服务器的网络上。的内容/etc/network/interfaces
是:
# interfaces(5) file used by ifup(8) and ifdown(8)
auto lo
iface lo inet loopback
我已经运行,grep -R '8\.8\.8\.8' /etc
并且8.8.8.8
在任何配置文件中都没有其他引用。下面也没有任何内容/etc/resolvconf
指的是Google DNS服务器!
为什么Ubuntu Mate要将Google DNS服务器添加到其中/etc/resolv.conf
,如何停止它?就目前而言,我已经完成了,sudo rm /etc/resolv.conf; sudo cp /run/resolvconf/resolv.conf /etc/resolv.conf; sudo chattr +i /etc/resolv.conf
但是我知道将来这会咬我...
经过大量调查(在@Terrance的帮助下),我发现Ubuntu Mate正在使用,avahi-dnsconfd
并且我网络上的其他设备(可能是Raspberry Pi)正在通过mDNS / Bonjor / Avahi广播Google的DNS服务器。
avahi-dnsconfd
正在捡起它,并且在avahi-dnsconfd.action
运行时,它正在resolvconf
通过mDNS发现添加DNS服务器的调用/etc/resolf.conf
我禁用了avahi-dnsconfd
使用:
sudo systemctl stop avahi-dnsconfd.service
sudo systemctl disable avahi-dnsconfd.service
我也做了很好的编辑/etc/default/avahi-daemon
和设置AVAHI_DAEMON_DETECT_LOCAL=0
(因为我知道我的网络没有服务于.local
TLD的单播DS服务器)
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句