Skip to content
Use the Node `dns` API in Chrome Apps
JavaScript HTML
Branch: master
Clone or download
Latest commit e251b7d Aug 9, 2019
Type Name Latest commit message Commit time
Failed to load latest commit information.
.npmignore initial commit Aug 10, 2019
.travis.yml initial commit Aug 10, 2019
LICENSE initial commit Aug 10, 2019 Update Aug 10, 2019
index.js initial commit Aug 10, 2019
package.json 1.0.1 Aug 10, 2019

chrome-dns travis npm downloads javascript style guide

Use the Node dns API in Chrome Apps

This module lets you use the Node.js dns API in Chrome Packaged Apps.

The chrome.dns API for Chrome Apps is not documented, but it still available. You need the "dns" permission in your manifest. As of August 2019, it appears that the API is only available if you use Chrome Dev channel or Canary channel.

Instead of learning the quirks of Chrome's chrome.dns API for networking in Chrome Apps just use the higher-level node API you're familiar with. Then, compile your code with browserify and you're all set!

This module is used by the Chrome App build of webtorrent, which is used in Brave Browser.


npm install chrome-dns


Use node's dns API. Example:

var dns = require('chrome-dns')

dns.lookup('', (err, address, family) => {
  if (err) {
  }` has the IPv${family} address of ${address}`)

See for full API documentation: dns


To run tests, use npm test && npm run test-browser. The tests will run TCP and UDP servers and launch a few different Chrome Packaged Apps with browserified client code. The tests currently require Chrome Canary.


MIT. Copyright (c) Feross Aboukhadijeh

You can’t perform that action at this time.