我经常同时连接到多个网络。这些网络均通过dhcp提供名称服务器配置。例如网络1:(eth0):
domain company1.corp #
nameserver 192.168.0.253
nameserver 192.168.0.254
网络2(tun0):
domain company2.corp #
nameserver 10.102.204.51
nameserver 10.102.208.51
#名称已更改
当同时连接到两个网络时:
# resolv.conf from NetworkManager
domain company1.corp, company2.corp
nameserver 192.168.0.253
nameserver 192.168.0.254
nameserver 10.102.204.51
# NOTE: the libc resolver may not support more than 3 nameservers.
# The nameservers listed below may not be recognized.
nameserver 10.102.208.51
解析service.company2.corp无效,因为名字服务器仅知道company1.corp名称。
因此受本文启发,我在Arch linux安装程序中设置了openresolv(一个resolvconf实现)来配置本地dnsmasq服务。
如果我使用resolvconf手动配置名称服务器:
# resolvconf -d NetworkManager
# echo "domain company1.corp
nameserver 192.168.0.253
nameserver 192.168.0.254
" | resolvconf -a eth0
# echo "domain company2.corp
nameserver 10.102.204.51
nameserver 10.102.208.51
" | resolvconf -a tun0
然后,我可以解析company1.corp和company2.corp的名称(本地dnsmasq服务器可以处理此名称。)
请注意,在手动配置之后,resolveconf -l分别显示两个配置:
~ # resolvconf -l
# resolv.conf from tun0
domain company2.corp
nameserver 10.102.204.51
nameserver 10.102.208.51
# resolv.conf from eth0
domain company1.corp
nameserver 192.168.0.253
nameserver 192.168.0.254
但是,让网络管理器进行配置时,这两种配置不是分开的,就像网络管理器正在写入/etc/resolve.conf一样。
~ # resolvconf -l
# resolv.conf from NetworkManager
# Generated by NetworkManager
domain company1.corp, company2.corp
nameserver 192.168.0.253
nameserver 192.168.0.254
nameserver 10.102.204.51
# NOTE: the libc resolver may not support more than 3 nameservers.
# The nameservers listed below may not be recognized.
nameserver 10.102.208.51
我的问题是如何让网络管理员正确调用resolveconf,以便分别注册每个接口的名称服务器。(不幸的是,对此进行谷歌搜索是没有用的,因为Google认为“ resolveconf” ==“ resolve.conf”)
"resolvconf"
使用引号进行搜索。务必在Google上用专有名词引号。