resolv.conf冲突覆盖了dhcpd,vpnc和docker之间的问题

时间:2019-03-10 17:23:30

标签: docker dns docker-compose vpn

我正在使用runit守护程序管理器在Void Linux上运行:

Void 4.19.27_1 x86_64 GenuineIntel notuptodate rrFFF

我为公司网络建立了一个VPNc连接。当我启动它时,它将生成并替换/etc/resolv.conf文件:

#@VPNC_GENERATED@ -- this file is generated by vpnc
# and will be overwritten by vpnc
# as long as the above mark is intact
# Generated by dhcpcd from enp0s31f6.dhcp
# /etc/resolv.conf.head can replace this line
domain int.company.net
nameserver 10.10.5.1
# /etc/resolv.conf.tail can replace this line

但是当我使用与网络交互的工具(例如docker-compose up)时,dhcpd会再次擦除配置:

# Generated by dhcpcd from enp0s31f6.dhcp
# /etc/resolv.conf.head can replace this line
domain home
nameserver 192.168.1.1
# /etc/resolv.conf.tail can replace this line

然后我对VPN的所有DNS解析都不再起作用。

如何解决此冲突问题?

谢谢

0 个答案:

没有答案