public static List < String > fromDnsSrv ( final String serviceName , boolean full , boolean secure , String nameServerIP ) throws NamingException { String fullService ; if ( full ) { fullService = serviceName ; } else { fullService = ( secure ? DEFAULT_DNS_SECURE_SERVICE : DEFAULT_DNS_SERVICE ) + serviceName ; } DirContext ctx ; if ( nameServerIP == null || nameServerIP . isEmpty ( ) ) { ctx = new InitialDirContext ( DNS_ENV ) ; } else { Hashtable < String , String > finalEnv = new Hashtable < String , String > ( DNS_ENV ) ; finalEnv . put ( "java.naming.provider.url" , "dns://" + nameServerIP ) ; ctx = new InitialDirContext ( finalEnv ) ; } return loadDnsRecords ( fullService , ctx ) ; }
Fetch a bootstrap list from DNS SRV using a specific nameserver IP .