5

I have some code that uses InetAddress.getByName . Intermittently I get a 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)

Performing nslookup google.com works, and the failure itself only happens occasionally. What could be causing this?

Louise Miller
  • 3,069
  • 2
  • 12
  • 13

1 Answers1

0

try to look at official java documentation

Throws: UnknownHostException - if no IP address for the host could be found, or if a scope_id was specified for a global IPv6 address.

Matej Špilár
  • 2,617
  • 3
  • 15
  • 28