|
From: Saran1 <har...@re...> - 2008-02-12 11:32:33
|
Hi,
I want to resolve the DNS names for the internal and external IPAddresses
using Java and DNSJava. Below java code resolve the names from 'hosts' file
first and then contact the DNS Server for resolution.
System.setProperty("sun.net.spi.nameservice.provider.1","dns,dnsjava");
InetAddress addr = InetAddress.getByName(ipaddress);
String dnsname = addr.getCanonicalHostName().trim();
System.out.println("DNS...........:" + dnsname);
But after setting the "dnsjava-2.0.3.jar" in classpath, the above code
doesn't look my 'hosts' file. Please let me know for any reason behind the
same.
My Requirement:
1. Faster the DNS Resolve [using dnsjava.jar]
2. First look for 'hosts' file, then contact DNS Server.
Please help me to solve the problem. Any help will be highly appreciated.
Thanks.
Saravanan
--
View this message in context: http://www.nabble.com/DNS-Resolve-from-hosts-file-first-then-DNS-Server-tp15431381p15431381.html
Sent from the dnsjava-users mailing list archive at Nabble.com.
|