Reputation: 155
We have a situation in our office where the first DNS resolver found by Android doesn't work over wireless (intentional or not, not sure). I'm doing an app to do whois lookups. I need to translate the whois server to IP using the second resolver (I can run the properties, see the two resolvers, figure out which one works). Unfortunately, as far as I can tell, INetAddress only works on the first resolver. Is there a known alternative, workaround, or anything I can use to get the IP address of a domain through a specified resolver? Even dnsjava itself uses INetAddress.
Thanks in advance
Upvotes: 0
Views: 407
Reputation: 5330
dnsjava does not use InetAdress.getByName()
or InetAddress.getAllByName()
.
Just use it like this:
System.setProperty("dns.server", "<resolver you want to use>");
InetAddress addr = Address.getByName("<name>");
Upvotes: 1