dns

The dns permission grants an extension access to the browser's DNS (Domain Name System) resolver.

Note: chrome.dns is gated behind the --enable-experimental-extension-apis flag and is only exposed on Chrome Dev/Canary channels. On Stable Chrome, chrome.dns is undefined even when the permission is declared.

What it does

  • Grants access to the chrome.dns API.
  • Allows an extension to resolve a hostname (like www.google.com) to its corresponding IP address (like 142.250.191.132).
  • The resolution is performed by the browser's built-in DNS client, respecting any custom DNS configurations the user or their system may have.

When to use it

This permission is primarily for developer tools or network analysis extensions.

Examples:

  • A "DNS lookup" tool for web developers.
  • A security extension that wants to check the IP address of a hostname against a blocklist before a navigation occurs.

Manifest Declaration

{
  "name": "My DNS Resolver",
  "version": "1.0",
  "manifest_version": 3,
  "permissions": [
    "dns"
  ]
}

Security & Privacy

Why is it not risky?

This is a technical permission that lets an extension look up the IP address for a website name (e.g., finding the address for "google.com").

It's safe because the extension cannot see the websites you are looking up. It can only make its own lookups. This permission doesn't expose any of your personal browsing data.

API Usage Example

This example resolves the hostname developer.chrome.com.

// background.js or popup.js

async function resolveHostname() {
  try {
    const result = await chrome.dns.resolve('developer.chrome.com');
    if (result.resultCode === 0) { // 0 indicates success
      console.log(`Resolved IP address: ${result.address}`);
    } else {
      console.error('Failed to resolve hostname.');
    }
  } catch (error) {
    console.error('DNS API error:', error);
  }
}

resolveHostname();

Extensions with the dns permission

Here are some popular browser extensions that use the "dns" permission. To explore more, try our Advanced search.

Permission Metrics

Popularity

Security Risk


Usage by Platform