cordova-plugin-dns

1.0.2 • Public • Published

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);

Package Sidebar

Install

npm i cordova-plugin-dns

Weekly Downloads

265

Version

1.0.2

License

Apache 2.0

Last publish

Collaborators

  • batkinson