Home / Function/ getSearchDomainsHack() — netty Function Reference

getSearchDomainsHack() — netty Function Reference

Architecture documentation for the getSearchDomainsHack() function in DnsNameResolver.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  38db9f3f_96ec_3af4_6653_4a388473f37b["getSearchDomainsHack()"]
  a8faea52_3f45_7b36_4918_3dfb9bd6ee9b["DnsNameResolver"]
  38db9f3f_96ec_3af4_6653_4a388473f37b -->|defined in| a8faea52_3f45_7b36_4918_3dfb9bd6ee9b
  style 38db9f3f_96ec_3af4_6653_4a388473f37b fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

resolver-dns/src/main/java/io/netty/resolver/dns/DnsNameResolver.java lines 201–216

    @SuppressWarnings("unchecked")
    private static List<String> 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<String>) nameservers.invoke(instance);
        }
        return Collections.emptyList();
    }

Subdomains

Frequently Asked Questions

What does getSearchDomainsHack() do?
getSearchDomainsHack() is a function in the netty codebase, defined in resolver-dns/src/main/java/io/netty/resolver/dns/DnsNameResolver.java.
Where is getSearchDomainsHack() defined?
getSearchDomainsHack() is defined in resolver-dns/src/main/java/io/netty/resolver/dns/DnsNameResolver.java at line 201.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free