下载wireshark 非常有帮助,但如果这对某人有帮助,我在Windows 网络上遇到了这种性质的问题。 Nslookup 总是会返回我想要的 IP,但 ping 不会。 我的问题是 DNS 设置为将未知域转发到外部 DNS 服务器。
如果我使用 DNS 服务器 ping mysite.dev 而不进行转发,则第一次 DNS 查找将失败,然后使用 mysite.dev.mydomain.com 重试并成功。
如果我使用具有转发功能的 DNS 服务器 ping mysite.dev,它会转发 URL(因为它是“未知域”)并从转发的 DNS 服务器取回一些垃圾 IP。 它返回的 IP 将您带到某个ask.com 搜索页面作为 404 的替代页面。 我猜想 ISP 一定是靠这个赚钱的。 这可以防止 DNS 客户端在添加我们的域 DNS 后缀的情况下重试。
请注意,还有另一个问题,其内部 URL 类似于 mysite.dev。 在 Windows Vista(可能还有 Windows 7)上,听起来您可能需要显式配置 DNS 客户端才能尝试将 DNS 后缀应用于 mysite.dev 之类的 URL:
Downloading wireshark is very helpful, but in case this helps someone, I had a problem of this nature on a Windows network. Nslookup would always return the IP I wanted, but ping would not. The problem in my case was DNS was set up to forward unknown domains to an external DNS server.
If I pinged mysite.dev using the DNS server without forwarding, the DNS lookup would fail the first time, then try again using mysite.dev.mydomain.com and succeed.
If I pinged mysite.dev using the DNS server with forwarding, it'd forward the URL (since it was an "unknown domain") and get back some garbage IP from the forwarded DNS server. The IP that it returned put you on some ask.com search page as a 404 substitute. I assume the ISP was making money off this somehow. This prevented the DNS client from retrying with our domain DNS suffix added.
Note there is another gotcha with internal urls similar to mysite.dev. On Windows Vista (and possibly Windows 7) it sounds like you might need to explicitly configure your DNS clients to try applying DNS suffixes to urls like mysite.dev:
发布评论
评论(4)
nslookup 仅使用 DNS,而 ping 将首先查找
hosts
文件。示例:
67.215.65.132 表示不存在的域 OpenDNS (hit-nxdomain.opendns.com)
nslookup uses only DNS, while ping will first look in
hosts
file.Example:
67.215.65.132 means non-existent domain OpenDNS (hit-nxdomain.opendns.com)
在您的计算机上运行
wireshark
的副本,并跟踪正在离开的 DNS 查询您的系统,看看它们之间有什么不同。请记住,
nslookup
根据定义仅查询 DNS。 其他应用程序将使用替代的查找机制(例如hosts
文件)。Run a copy of
wireshark
on your machine and trace the DNS queries that are leaving your system and see what's different between them.Bear in mind that
nslookup
by definition only queries the DNS. Other applications will use alternative lookup mechanisms (e.g. thehosts
file).下载wireshark 非常有帮助,但如果这对某人有帮助,我在Windows 网络上遇到了这种性质的问题。 Nslookup 总是会返回我想要的 IP,但 ping 不会。 我的问题是 DNS 设置为将未知域转发到外部 DNS 服务器。
如果我使用 DNS 服务器 ping mysite.dev 而不进行转发,则第一次 DNS 查找将失败,然后使用 mysite.dev.mydomain.com 重试并成功。
如果我使用具有转发功能的 DNS 服务器 ping mysite.dev,它会转发 URL(因为它是“未知域”)并从转发的 DNS 服务器取回一些垃圾 IP。 它返回的 IP 将您带到某个ask.com 搜索页面作为 404 的替代页面。 我猜想 ISP 一定是靠这个赚钱的。 这可以防止 DNS 客户端在添加我们的域 DNS 后缀的情况下重试。
请注意,还有另一个问题,其内部 URL 类似于 mysite.dev。 在 Windows Vista(可能还有 Windows 7)上,听起来您可能需要显式配置 DNS 客户端才能尝试将 DNS 后缀应用于 mysite.dev 之类的 URL:
http://blogs.technet.com/ b/networking/archive/2009/04/16/dns-client-name-resolution-behavior-in-windows-vista-vs-windows-xp.aspx
Downloading wireshark is very helpful, but in case this helps someone, I had a problem of this nature on a Windows network. Nslookup would always return the IP I wanted, but ping would not. The problem in my case was DNS was set up to forward unknown domains to an external DNS server.
If I pinged mysite.dev using the DNS server without forwarding, the DNS lookup would fail the first time, then try again using mysite.dev.mydomain.com and succeed.
If I pinged mysite.dev using the DNS server with forwarding, it'd forward the URL (since it was an "unknown domain") and get back some garbage IP from the forwarded DNS server. The IP that it returned put you on some ask.com search page as a 404 substitute. I assume the ISP was making money off this somehow. This prevented the DNS client from retrying with our domain DNS suffix added.
Note there is another gotcha with internal urls similar to mysite.dev. On Windows Vista (and possibly Windows 7) it sounds like you might need to explicitly configure your DNS clients to try applying DNS suffixes to urls like mysite.dev:
http://blogs.technet.com/b/networking/archive/2009/04/16/dns-client-name-resolution-behavior-in-windows-vista-vs-windows-xp.aspx
从您的 ipconfig 示例中,我假设您使用 Windows。
nslookup 仅是 DNS。
主机将使用您系统上的正常解析过程。 这可能包括(但不限于:主机、Windows 命名和 DNS)。
如何获取 Firefox 使用的 IP 地址? 如果它出现在 URL 中,您应该忽略它,因为该级别可能会发生很多事情。
From your ipconfig example, I am assuming you using Windows.
nslookup is DNS only.
hosts will use the normal resolution process on your system. This could include (but is not limited to: hosts, Windows naming, and DNS).
How are you getting the IP address that Firefox uses? If it appears in the URL, you should ignore that, many things could be happening at that level.