[英]Java Inetaddress getallbyname error
I am using Java InetAddress to find if the current internet connection can resolve an address via DNS. 我正在使用Java InetAddress查找当前的互联网连接是否可以通过DNS解析地址。 However if I put in a random address (One that definitely dose not exist on the internet) I still get an IP back, can anyone explain why this is the case?
但是,如果我输入一个随机地址(互联网上肯定没有这样的地址),我仍然可以获得IP地址,有人可以解释为什么会这样吗?
Code I am Using: 我正在使用的代码:
hosts = InetAddress.getAllByName(site.getSite());
for(InetAddress host : hosts) {
System.out.println(result_pref+"Ok "+ host);
}
Output by command prompt: Testing DNS Host: www.goooglelsdkfjsdlkfjsdklj.com - Result: Ok www.goooglelsdkfjsdlkfjsdklj.com/67.215.65.132 通过命令提示符输出:测试DNS主机:www.goooglelsdkfjsdlkfjsdklj.com-结果:确定www.goooglelsdkfjsdlkfjsdklj.com/67.215.65.132
Thanks in advance 提前致谢
67.215.65.132 address point to the webpage Hosted by the DNS server (the open you are using) in this case OpenDNS. 67.215.65.132地址指向DNS服务器托管的网页(在此情况下为OpenDNS)。 THis simply means 404-Page Not found
这仅表示未找到404页
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.