Jos*_*osh 9 dns resolvconf ubuntu-mate 16.04
更新:看起来它正在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)
Run Code Online (Sandbox Code Playgroud)
我怎样才能让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
Run Code Online (Sandbox Code Playgroud)
我不8.8.4.4
想也不想8.8.8.8
,/etc/resolv.conf
因为这会破坏我的本地网络:我的本地 DNS 服务器 (10.100.1.1) 为没有公共 DNS 记录的本地 NATed 服务提供 DNS。
如果我手动编辑/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
Run Code Online (Sandbox Code Playgroud)
我已经运行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
Run Code Online (Sandbox Code Playgroud)
为了更好地衡量,我还进行了编辑/etc/default/avahi-daemon
和设置AVAHI_DAEMON_DETECT_LOCAL=0
(因为我知道我的网络没有为.local
TLD 提供服务的单播 DS 服务器)
归档时间: |
|
查看次数: |
1951 次 |
最近记录: |