我在 Virtualbox 中使用 Debian 作为来宾进行了简单安装。我安装了这个resolvconf包。resolv.conf 文件是这样的:
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
# DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 8.8.8.8
nameserver 10.3.x.x
nameserver 10.219.x.x
Run Code Online (Sandbox Code Playgroud)
我通过 GUI(应用程序/系统工具/网络工具)添加了名称服务器。
8.8.8.8 是谷歌的DNS,我想用它来解析互联网地址。需要 10.3.xx 和 10.219.xx 来解析像 teleportal.company.intra 这样的内部域。
当我在 resolv.conf 中有这些名称服务器(并且 8.8.8.8 是第一个)时,在查询内部地址时出现错误:
> host teleportal.company.intra
Host teleportal.company.intra not found: 3(NXDOMAIN)
Run Code Online (Sandbox Code Playgroud)
但是,如果我将第二个nameserver地址显式设置为 nslookup 的名称服务器,它会起作用:
» nslookup teleportal.company.intra 10.3.x.x
Server: 10.3.x.x
Address: 10.3.x.x#53
teleportal.company.intra canonical name = proxy.dummy1.dummy2.private.
Name: …Run Code Online (Sandbox Code Playgroud)