InetAddress.getByName 间歇性失败并出现系统错误

Lou*_*ler 5 java nslookup

我有一些使用InetAddress.getByName. 间歇性地我得到一个UnknownHostException

java.net.UnknownHostException: google.com: System error
    at java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method)
    at java.net.InetAddress$1.lookupAllHostAddr(InetAddress.java:901)
    at java.net.InetAddress.getAddressesFromNameService(InetAddress.java:1293)
    at java.net.InetAddress.getAllByName0(InetAddress.java:1246)
    at java.net.InetAddress.getAllByName(InetAddress.java:1162)
    at java.net.InetAddress.getAllByName(InetAddress.java:1098)
    at java.net.InetAddress.getByName(InetAddress.java:1048)
Run Code Online (Sandbox Code Playgroud)

表演nslookup google.com作品,而失败本身只是偶尔发生。什么可能导致这种情况?

Mat*_*lár 0

尝试查看官方java文档

抛出: UnknownHostException - 如果找不到主机的 IP 地址,或者为全局 IPv6 地址指定了scope_id。