cordova-plugin-dns
v1.0.2
Published
Manually resolve DNS hostnames to IPs for diagnosing network setup.
Downloads
697
Maintainers
Readme
Cordova DNS Plugin
A plugin for Apache Cordova that enables applications to manually resolve hostnames into an underlying network address. This is mostly useful for determining whether there is a problem with the device's DNS server configuration.
Usage
To install, simply add to your project as you would any other cordova plugin:
cordova plugin add cordova-plugin-dns
Once installed, you should be able to use the JavaScript function to resolve host names:
var hostname = 'myhost.example.com';
function success(address) {
console.log('Resolved ' + hostname + ' to ' + address);
}
function failure(error) {
console.log('Failed to resolve ' + hostname + ': ' + error);
}
cordova.plugins.dns.resolve(hostname, success, failure);