improving java.net.UnknownHostException
Alan Bateman
Alan.Bateman at oracle.com
Fri Oct 29 19:10:09 UTC 2021
On 29/10/2021 14:44, Richard Gibson wrote:
> The OCI DNS team are fielding an increasing amount of usage by
> customers relying upon Java, and the lack of detail associated with
> java.net.UnknownHostException for differentiating e.g. timeout vs.
> NXDOMAIN vs. NODATA vs. SERVFAIL vs. REFUSED has cost a great deal of
> time in investigating issues. Does anyone on this list know how to get
> the ball rolling on improving things?
I will guess that these customers are using the InetAddress API which
will use getaddrinfo and maybe too high level for what you are looking
for. If getaddrinfo fails then the gai_strerror is used to get the error
description. As Daniel points out, there is a service provider interface
in the work (JEP 416) that will allow deploying alternative underlying
resolver implementations. This may be a possible direction to explore if
you really want fine control on the DNS lookups.
-Alan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.java.net/pipermail/net-dev/attachments/20211029/c23d4bfd/attachment.htm>
More information about the net-dev
mailing list