- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
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/
我是一名优秀的程序员,十分优秀!