Our great sponsors
-
WorkOS
The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.
private static List getSearchDomainsHack() throws Exception { // Only try if not using Java9 and later // See https://github.com/netty/netty/issues/9500 if (PlatformDependent.javaVersion() < 9) { // This code on Java 9+ yields a warning about illegal reflective access that will be denied in // a future release. There doesn't seem to be a better way to get search domains for Windows yet. Class configClass = Class.forName("sun.net.dns.ResolverConfiguration"); Method open = configClass.getMethod("open"); Method nameservers = configClass.getMethod("searchlist"); Object instance = open.invoke(null); return (List) nameservers.invoke(instance); } return Collections.emptyList(); }