Overview
DNS (Domain Name System) translates human-readable domain names (likeexample.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:| Blocker | Blocks | Use Case |
|---|---|---|
| Ads | Advertisement domains | Remove ads from websites and apps |
| Trackers | Tracking and analytics domains | Enhance privacy, prevent tracking |
| Malware | Known malicious domains | Security protection |
| Adult Content | Adult/NSFW domains | Family safety, parental controls |
| Gambling | Gambling and betting sites | Responsible usage controls |
| Social Media | Social networking platforms | Productivity, digital wellness |
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
Enable Blockers
Toggle on desired content blockers:
- ☑ Block ads
- ☑ Block trackers
- ☑ Block malware
- ☐ Block adult content
- ☐ Block gambling
- ☐ Block social media
Using the CLI
How Content Blocking Works
- App makes DNS request:
example-ad-network.com - Mullvad DNS checks blocklist: Is domain in ad blocker list?
- Block or allow:
- Blocked: Returns
0.0.0.0orNXDOMAIN(domain does not exist) - Allowed: Returns real IP address
- Blocked: Returns
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
Popular Public DNS Servers
| Provider | IPv4 | IPv6 | Features |
|---|---|---|---|
| Cloudflare | 1.1.1.1, 1.0.0.1 | 2606:4700:4700::1111 | Fast, privacy-focused |
8.8.8.8, 8.8.4.4 | 2001:4860:4860::8888 | Reliable, widely available | |
| Quad9 | 9.9.9.9 | 2620:fe::fe | Malware blocking |
| OpenDNS | 208.67.222.222, 208.67.220.220 | 2620:119:35::35 | Filtering, parental controls |
Configuring Custom DNS
Using the GUI
Add DNS Servers
- Click Add
- Enter DNS server IP address (IPv4 or IPv6)
- Add multiple servers (primary, secondary)
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)
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
| Destination | Default DNS | Custom DNS (1.1.1.1) | Result |
|---|---|---|---|
| Relay gateway | ✅ Allowed | ❌ Blocked | As configured |
1.1.1.1 | ❌ Blocked | ✅ Allowed | As configured |
8.8.8.8 | ❌ Blocked | ❌ Blocked | Prevents leak |
| ISP DNS | ❌ Blocked | ❌ Blocked | Prevents leak |
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:- ✅ WireGuard protocol
- ✅ Quantum-resistant tunnels
- ✅ Multihop
- ✅ DAITA
- ✅ Obfuscation protocols
- ✅ Split tunneling*
- ✅ Local network access
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
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 viaTALPID_DNS_MODULE environment variable:
| Method | Description | Use When |
|---|---|---|
static-file | Modifies /etc/resolv.conf directly | Default on most systems |
resolvconf | Uses resolvconf program | System has resolvconf installed |
systemd | Uses systemd-resolved via DBus | systemd-resolved is active |
network-manager | Uses NetworkManager via DBus | NetworkManager manages network |
Overriding DNS Method (Linux)
Troubleshooting
DNS Not Working
If you cannot resolve domain names:-
Check DNS settings:
-
Test DNS resolution:
-
Return to default DNS:
-
Reconnect:
Private DNS Not Accessible
If private DNS server (e.g.,192.168.1.1) is unreachable:
-
Enable local network access:
- Verify server is on local network: Ensure it’s actually a LAN address
-
Test connectivity:
- macOS: Private DNS not supported; use default or public DNS
Content Blocking Not Working
If ads/trackers still appear:-
Verify blockers enabled:
Should show:
-
Clear DNS cache:
Windows:
macOS:Linux:
-
Test blocked domain:
Should return
0.0.0.0or NXDOMAIN - Browser cache: Clear browser cache and reload
- First-party ads: DNS blocking cannot block ads from same domain
DNS Leaks
To verify no DNS leaks:-
Use leak test site:
- Should show: Mullvad DNS servers (or your custom DNS)
- Should NOT show: ISP DNS servers or unexpected DNS
- If leaking: Check firewall rules, reconnect VPN
Best Practices
Privacy-Focused Configuration
- No third-party DNS providers
- Mullvad’s no-logs policy
- Content blocking included
- Lowest latency (DNS on relay server)
Public DNS Provider
- Trust DNS provider’s privacy policy
- May have better performance in some regions
- Some provide additional filtering
Local Network DNS
- 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
Related Features
- Local Network Access - Required for private DNS
- Split Tunneling - DNS behavior with excluded apps
- Kill Switch - DNS leak protection during transitions
- Content Blockers - DNS-based filtering
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)