Docker – 从容器内设置DNS – 用于VPN?

我试图设置一个docker容器来访问我的VPN(IVPN)。 我想使用VPN的DNS, DNS是根据我分配的IP地址select的 – 发生在容器内…

https://www.ivpn.net/knowledgebase/163/What-is-the-IP-address-of-your-DNS-servers.html

To work out the address of the closest DNS server simply look at the IP assigned to you when you connect. The DNS servers are in the format 10.xx1. For example, if you receive the address 10.16.4.66 then the DNS is on 10.16.4.1. 
  1. 有没有从容器内更新DNS的方法?
  2. 或者我可以(通过…大规模过度devise解决scheme)启动容器,获取由VPN分配的IP地址,然后(以某种方式)从主机执行DNS更新?
  3. 我只是放弃和硬编码一些不是“最接近”的DNS服务器

[编辑感谢@MrE]我想在容器中运行openvpn(所以我会使用别人的形象) – 并让其他容器使用这个作为他们唯一的连接到'networking。 基本上,我试图build立完全隔离的容器,然后通过我们的企业(或其他商业)VPN来configuration它们的连接。