Skip to main content

Overview

DNS (Domain Name System) translates human-readable domain names (like example.com) into IP addresses. By default, Mullvad routes all DNS requests through the VPN tunnel to the relay server, preventing DNS leaks and ensuring privacy. With custom DNS, you can:
  • Use your own DNS servers: Private DNS, corporate DNS, or public resolvers
  • Enable content blocking: Block ads, trackers, malware, adult content, gambling, or social media
  • Access local services: Use private DNS servers on your network
Custom DNS is available on all platforms: Windows, Linux, macOS, Android, and iOS.

DNS Options

Mullvad provides two DNS configurations:

Default DNS (Mullvad’s DNS)

Uses Mullvad’s DNS resolver running on the VPN relay server:
  • Resolver: VPN relay server (gateway IP)
  • Privacy: No logging, no third-party involvement
  • Content blocking: Optional filtering (ads, trackers, malware, etc.)
  • Performance: Low latency (DNS on same server as VPN)

Custom DNS

Use your own DNS servers:
  • Resolver: Any IP address (public or private)
  • Privacy: Depends on chosen DNS provider
  • Content blocking: Depends on DNS provider
  • Performance: Varies by server location and load

Default DNS with Content Blocking

Available Blockers

Mullvad’s DNS supports six types of content blocking:
Content blockers use DNS-based filtering. They block entire domains but cannot block specific pages or content within a site.

Enabling Content Blockers

Using the GUI

1

Open DNS Settings

Navigate to SettingsVPN settingsDNS settings
2

Ensure Default DNS

Verify Use default DNS is selected (not custom DNS)
3

Enable Blockers

Toggle on desired content blockers:
  • Block ads
  • Block trackers
  • Block malware
  • Block adult content
  • Block gambling
  • Block social media
4

Apply Changes

Settings apply immediately (no reconnection needed)

Using the CLI

How Content Blocking Works

  1. App makes DNS request: example-ad-network.com
  2. Mullvad DNS checks blocklist: Is domain in ad blocker list?
  3. Block or allow:
    • Blocked: Returns 0.0.0.0 or NXDOMAIN (domain does not exist)
    • Allowed: Returns real IP address
Limitations of DNS-based blocking:
  • Cannot block specific URLs (only entire domains)
  • Cannot block first-party ads (ads served from same domain)
  • Does not inspect or modify content (unlike browser ad blockers)
  • Some sites may detect and restrict access if ads are blocked

Custom DNS Servers

When to Use Custom DNS

Use custom DNS for:
  • Private DNS servers on your network
  • Corporate/organizational DNS
  • Specific DNS providers (Cloudflare, Google, Quad9)
  • Advanced filtering services
  • Local domain resolution

Configuring Custom DNS

Using the GUI

1

Open DNS Settings

Navigate to SettingsVPN settingsDNS settings
2

Select Custom DNS

Choose Use custom DNS
3

Add DNS Servers

  • Click Add
  • Enter DNS server IP address (IPv4 or IPv6)
  • Add multiple servers (primary, secondary)
4

Save

Changes apply immediately

Using the CLI

Private DNS Servers

For private networks (home, office):
Private DNS behavior:
  • Private IPs (10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16) are accessed outside the tunnel (via LAN)
  • Requires Local Network Access enabled
  • Public IPs are accessed through the VPN tunnel

DNS Routing Behavior

Default DNS (Mullvad)

  • All DNS requests: Sent inside the tunnel to relay server
  • No leaks: DNS never leaves the VPN
  • Privacy: Mullvad’s no-logs policy applies

Custom Public DNS

Public DNS servers (e.g., 8.8.8.8, 1.1.1.1):
  • Routed through VPN tunnel
  • VPN IP address: DNS provider sees VPN server IP, not your real IP
  • Privacy: Depends on DNS provider’s logging policy

Custom Private DNS

Private DNS servers (e.g., 192.168.1.1, 10.0.0.53):
  • Routed outside tunnel (direct connection)
  • Requires: Local network access enabled
  • Use case: Access local domains (e.g., printer.local, nas.home)
macOS limitation: Private custom DNS is not supported. All custom DNS is routed through the tunnel, regardless of IP range.

DNS Leak Protection

Mullvad prevents DNS leaks through firewall rules:

Blocked DNS Requests

In the Connected state, the firewall:
  • Allows: DNS to relay server (default) or custom DNS servers
  • Blocks: DNS to any other destination (port 53 TCP/UDP)

Example Scenarios

DNS requests to unauthorized destinations are blocked by the firewall, even if your OS or apps try to use different DNS servers.

DNS in Different Tunnel States

Connected State

  • Default DNS: Requests to relay gateway allowed
  • Custom DNS: Requests to specified servers allowed
  • All other DNS: Blocked by firewall

Disconnected State

  • Default behavior: System DNS used (typically ISP’s DNS)
  • No DNS enforcement: Mullvad does not modify DNS settings

Connecting, Disconnecting, Error States

  • All DNS requests blocked (except API traffic)
  • Protects against DNS leaks during connection transitions
  • Part of the kill switch functionality

Compatibility

Custom DNS works with: *See DNS with Split Tunneling for behavior.

DNS with Split Tunneling

DNS behavior is complex when split tunneling is enabled:

Desktop (Windows, Linux, macOS)

DNS requests from excluded apps:
  • Still go through system DNS resolver
  • System DNS resolver uses tunnel DNS (not excluded)
  • Result: Excluded apps use same DNS as normal apps
On desktop, split tunneling does NOT split DNS. All DNS requests (including from excluded apps) use the VPN’s DNS configuration.

Android

DNS requests from excluded apps:
  • Bypasses VPN entirely
  • Uses system DNS (typically from WiFi/mobile network)
  • Result: Excluded apps use different DNS than normal apps

DNS Methods (Advanced)

Mullvad supports multiple DNS configuration methods on Linux:

Available Methods

Set via TALPID_DNS_MODULE environment variable: Default is auto-detected based on system configuration.

Overriding DNS Method (Linux)

Troubleshooting

DNS Not Working

If you cannot resolve domain names:
  1. Check DNS settings:
  2. Test DNS resolution:
  3. Return to default DNS:
  4. Reconnect:

Private DNS Not Accessible

If private DNS server (e.g., 192.168.1.1) is unreachable:
  1. Enable local network access:
  2. Verify server is on local network: Ensure it’s actually a LAN address
  3. Test connectivity:
  4. macOS: Private DNS not supported; use default or public DNS

Content Blocking Not Working

If ads/trackers still appear:
  1. Verify blockers enabled:
    Should show:
  2. Clear DNS cache: Windows:
    macOS:
    Linux:
  3. Test blocked domain:
    Should return 0.0.0.0 or NXDOMAIN
  4. Browser cache: Clear browser cache and reload
  5. First-party ads: DNS blocking cannot block ads from same domain

DNS Leaks

To verify no DNS leaks:
  1. Use leak test site:
  2. Should show: Mullvad DNS servers (or your custom DNS)
  3. Should NOT show: ISP DNS servers or unexpected DNS
  4. If leaking: Check firewall rules, reconnect VPN

Best Practices

Privacy-Focused Configuration

Advantages:
  • No third-party DNS providers
  • Mullvad’s no-logs policy
  • Content blocking included
  • Lowest latency (DNS on relay server)

Public DNS Provider

Considerations:
  • Trust DNS provider’s privacy policy
  • May have better performance in some regions
  • Some provide additional filtering

Local Network DNS

Use cases:
  • Access local devices by hostname
  • Corporate network DNS
  • Pi-hole or local ad blocker

Performance Considerations

DNS Latency

  • Default DNS: ~1-5ms (on relay server)
  • Custom public DNS: Varies (typically 10-50ms)
  • Custom private DNS: Depends on LAN (usually <10ms)

DNS Caching

  • System DNS cache: Reduces repeated lookups
  • Browser DNS cache: Further optimization
  • TTL: Respect DNS Time-To-Live values

Technical Details

DNS Configuration Methods

From source code (mullvad-types/src/settings/dns.rs):

Firewall Rules

Mullvad’s firewall allows DNS only to:
  • Relay gateway IP (when using default DNS)
  • Configured custom DNS IPs (when using custom DNS)
  • Loopback interface (always allowed)
All other DNS traffic (port 53 TCP/UDP) is blocked.

Further Reading