Skip to main content

Overview

The mullvad dns command manages DNS configuration including Mullvad’s default DNS with content blocking or custom DNS servers.

Syntax

Subcommands

get

Display current DNS settings:

set

Configure DNS servers:

Set Modes

default

Use Mullvad’s default DNS servers with optional content blocking:
Options:
  • --block-ads - Block domains known for advertising
  • --block-trackers - Block domains known for tracking
  • --block-malware - Block domains known for malware
  • --block-adult-content - Block domains with adult content
  • --block-gambling - Block domains known for gambling
  • --block-social-media - Block social media domains
All blocking options are disabled by default. Enable any combination by specifying the flags.

custom

Use custom DNS servers:
Arguments:
  • <SERVER>... - One or more IP addresses of DNS resolvers

Examples

View Current DNS Settings

With default DNS:
With custom DNS:

Use Default DNS

Default DNS without blocking:
Output:

Enable Content Blocking

Block ads and trackers:
Block malware:
Block multiple categories:
Block everything:

Use Custom DNS Servers

Single DNS server:
Multiple DNS servers:
IPv6 DNS servers:
Mixed IPv4 and IPv6:
Output:

Content Blocking Categories

Ads

Blocks domains commonly used for advertising and sponsored content. Example blocked domains:
  • Ad networks
  • Ad servers
  • Sponsored content providers

Trackers

Blocks domains used for user tracking and analytics. Example blocked domains:
  • Analytics platforms
  • Tracking pixels
  • Fingerprinting services

Malware

Blocks domains known to distribute malware or participate in malicious activities. Example blocked domains:
  • Malware distribution sites
  • Phishing domains
  • Command and control servers

Adult Content

Blocks domains hosting adult/NSFW content.

Gambling

Blocks online gambling and betting sites.

Social Media

Blocks popular social media platforms. Example blocked domains:
  • Facebook
  • Twitter/X
  • Instagram
  • TikTok

DNS Modes

There are two DNS modes:
  1. Default - Uses Mullvad’s DNS servers with optional content blocking
  2. Custom - Uses your specified DNS servers (no content blocking available)
When using custom DNS, content blocking options are unavailable.
  • tunnel - Configure other tunnel options
  • connect - Connect with current DNS settings
  • status - View connection status

Exit Status

Notes

  • DNS changes take effect on the next connection (reconnect if already connected)
  • Custom DNS servers must be valid IP addresses
  • Content blocking only works with Mullvad’s default DNS
  • Both IPv4 and IPv6 DNS servers are supported
  • Multiple DNS servers provide redundancy
  • Content blocking is implemented at the DNS level (domain blocking)

Source Reference

Implementation: mullvad-cli/src/cmds/dns.rs