gpt4 book ai didi

dns - virtualbox:--natdnsproxy1 和--natdnshostresolver1 有什么区别?

转载 作者:行者123 更新时间:2023-12-03 07:49:50 25 4
gpt4 key购买 nike

virtualbox 文档没有解释清楚。
https://www.virtualbox.org/manual/ch09.html

9.11.5. Enabling DNS proxy in NAT mode The NAT engine by default offers the same DNS servers to the guest that are configured on thehost. In some scenarios, it can be desirable to hide the DNS serverIPs from the guest, for example when this information can change onthe host due to expiring DHCP leases. In this case, you can tell theNAT engine to act as DNS proxy using the following command:

VBoxManage modifyvm "VM name" --natdnsproxy1 on

9.11.6. Using the host's resolver as a DNS proxy in NAT mode For resolving network names, the DHCP server of the NAT engine offers alist of registered DNS servers of the host. If for some reason youneed to hide this DNS server list and use the host's resolversettings, thereby forcing the VirtualBox NAT engine to intercept DNSrequests and forward them to host's resolver, use the followingcommand:

VBoxManage modifyvm "VM name" --natdnshostresolver1 on Note that thissetting is similar to the DNS proxy mode, however whereas the proxymode just forwards DNS requests to the appropriate servers, theresolver mode will interpret the DNS requests and use the host's DNSAPI to query the information and return it to the guest.


谁能真正理解其中的区别?
编辑:需要一个实际的例子。

最佳答案

如果 natdnsproxy如果启用了 NAT 类型的网络适配器选项,VirtualBox 的 NAT 网关将接受来自 guest 的 DNS 流量并将其转发到主机使用的解析器。它将仅充当网络层代理。只有发送到网关 IP 的 DNS 流量会被重定向,它不会拦截发送到其他 IP 的 DNS 流量。确保您的访客使用您的网关 IP(例如 10.0.2.2 )作为解析器(如果您的访客使用 DHCP,这应该可以直接使用)。
natdnshostresolver选项类似——它也会导致 NAT 网关接受 DNS 流量——但网关将读取(即解析)查询并使用主机的操作系统 API 来解决它。在 Linux 上,这将是 getaddrinfo() .这是恕我直言的首选选项。

数字 (1) 指的是网络适配器,可以互换。 --natdnshostresolver2 on将为给定 VM 的第二个接口(interface)启用该选项。

关于dns - virtualbox:--natdnsproxy1 和--natdnshostresolver1 有什么区别?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51060639/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com