Override provider URL when initializing DNS context in case it is defined on classpath
@@ -146,6 +146,7 @@ public final class DefaultDnsResolver implements DnsResolver {
private static InitialDirContext createDnsDirContext() {
Hashtable<String, String> envProps = new Hashtable<String, String>();
envProps.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.dns.DnsContextFactory");
+ envProps.put(Context.PROVIDER_URL, "dns:");
try {
return new InitialDirContext(envProps);
} catch (NamingException e) {
