public static String getOriginalHostNameFromInetAddress(InetAddress addr) {
        if (Build.VERSION.SDK_INT > 27) {
            try {
                Method getHolder = InetAddress.class.getDeclaredMethod("holder");
                getHolder.setAccessible(true);

                Method getOriginalHostName = Class.forName("java.net.InetAddress$InetAddressHolder")
                                                     .getDeclaredMethod("getOriginalHostName");
                getOriginalHostName.setAccessible(true);

                String originalHostName =
                        (String) getOriginalHostName.invoke(getHolder.invoke(addr));
                if (originalHostName == null) {
                    return addr.getHostAddress();
                }
                return originalHostName;
            } catch (InvocationTargetException e) {
                throw new RuntimeException("Failed to get originalHostName", e);
            } catch (ClassNotFoundException ignore) {
                // passthrough and return addr.getHostAddress()
            } catch (IllegalAccessException ignore) {
                //Ignored
            } catch (NoSuchMethodException ignore) {
                //Ignored
            }
        }
        return addr.getHostAddress();
    }
Provides extended capabilities for the session if supported by the platform.
android/src/main/java/org/conscrypt/Platform.java