[英]InetAddress can't resolve some domains, throws java.net.UnknownHostException, but domains actually work in the browser
InetAddress fails to resolve the following domains: InetAddress无法解析以下域:
kymcolux.com
shencan.net
zoocore.com
Tested on my home computer and a VPS with: 在我的家用计算机和VPS上进行了以下测试:
InetAddress addr1 = InetAddress.getByName("kymcolux.com");
https://httpstatus.io/ also can't fetch the URLs. https://httpstatus.io/也无法获取网址。
InetAddress throws: InetAddress引发:
java.net.UnknownHostException: zoocore.com: unknown error
at java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method)
at java.net.InetAddress$2.lookupAllHostAddr(InetAddress.java:907)
at java.net.InetAddress.getAddressesFromNameService(InetAddress.java:1302)
at java.net.InetAddress.getAllByName0(InetAddress.java:1255)
at java.net.InetAddress.getAllByName(InetAddress.java:1171)
at java.net.InetAddress.getAllByName(InetAddress.java:1105)
at java.net.InetAddress.getByName(InetAddress.java:1055)
at Main.main(Main.java:16)
Strangely they work in my browser. 奇怪的是,它们在我的浏览器中工作。
UPDATE Tried different DNS servers (Google & OpenDNS). 更新尝试了不同的DNS服务器(Google和OpenDNS)。 Still the same result.
结果还是一样。
Any ideas? 有任何想法吗? Thanks!
谢谢!
如下所示,将www附加到网址后,看看它是否有效:
InetAddress addr1 = InetAddress.getByName("www.kymcolux.com");
The following sites are not even reachable from my browser without adding the www. 如果不添加www,则无法从我的浏览器访问以下站点。 initially.
原来。 You might be able to open them in your browser if you previously visited these sites.
如果您以前访问过这些站点,则可以在浏览器中打开它们。
Note the following output: 注意以下输出:
java.net.InetAddress.getByName("google.com");//google.com/216.58.208.238
java.net.InetAddress.getByName("www.google.com");//www.google.com/216.58.210.196
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.