CAB*_*CAB 5 networking dns 12.04 resolvconf
我需要重新排序 /etc/resolv.conf 以在 12.04 服务器(无 NetworkManager)上的 eth0 dhcp 提供的名称服务器之前列出 eth1 dhcp 提供的名称服务器。
我编辑了 /etc/resolveconf/interface-order 并将其 'eth*' 条目替换为;
eth1
eth0
Run Code Online (Sandbox Code Playgroud)
然后尝试resolvconf -u
, ifdown'ed 和 ifup'ed 每个接口dpkg-reconfigure resolvconf
,service networking restart
然后重新启动。这些都对 resolv.conf 的顺序没有任何影响。我错过了什么?
resolvconf 记录的名称遵循以下模式
IFACE.CONFIGURER
Run Code Online (Sandbox Code Playgroud)
因此,要强制 eth1* 记录出现在您需要替换的其他 eth* 记录之前
eth*
Run Code Online (Sandbox Code Playgroud)
和
eth1*
eth*
Run Code Online (Sandbox Code Playgroud)
进行此更改后,请执行
sudo resolvconf -u
Run Code Online (Sandbox Code Playgroud)