A Plugin for querying IP addresses to domain names
cordova plugin add cordova-dns-plugin
// Resolving single IP address
cordova.plugins.dns.resolve('seed.bitcoin.sipa.be',function (ip) {
console.log("Resolved IP address: " + ip);
},function(error) {
console.log("Error: " + error);
});
// Resolving all available IP addresses
cordova.plugins.dns.resolveAll('seed.bitcoin.sipa.be',function (ips) {
ips.forEach(function(ip) {
console.log("Resolved IP address: " + ip);
});
},function(error) {
console.log("Error: " + error);
});
- Android
- Add tests as plugin
cordova plugin add https://github.com/getbitpocket/cordova-dns-plugin.git#:/tests
- Follow the Cordova Plugins Tests guide
- Run the tests by launching app
cordova emulate