Skip to main content

DNS-MNS Passwall Integration Guide

This guide covers the seamless integration between DNS-MNS and Passwall/Passwall2 proxy on OpenWrt routers, available in DNS-MNS v6.5.0.

Overview

Passwall is a popular OpenWrt package that provides transparent proxy/VPN functionality with support for Shadowsocks, V2Ray, XRay, Trojan, and other protocols. DNS-MNS integrates with Passwall to provide optimized DNS resolution while Passwall handles proxy traffic.

Key Features

  • Auto-Detection - Automatically detects Passwall/Passwall2 installation
  • Three Integration Modes - Cooperative, Integrated, and Override
  • Smart DNS Sync - Synchronizes DNS-MNS optimized servers with Passwall
  • Gaming Optimization - DNS recommendations based on Passwall’s proxy mode
  • Backup & Restore - Safely backup and restore configurations
  • UCI Integration - Native OpenWrt UCI configuration management

Architecture

Integration Modes

In cooperative mode, DNS-MNS and Passwall work independently:
  • DNS-MNS handles DNS resolution with optimized servers
  • Passwall handles proxy/VPN traffic routing
  • Best for most users who want optimal performance
How it works:
  1. DNS-MNS runs on port 5353 (or custom port)
  2. dnsmasq uses DNS-MNS as upstream DNS
  3. Passwall routes proxy traffic through its configured servers
  4. DNS queries and proxy traffic are handled separately

Integrated Mode

In integrated mode, DNS-MNS routes upstream queries through Passwall’s proxy:
  • Use case when DNS is blocked and needs to go through proxy tunnel
  • Benefit bypasses DNS blocking in heavily restricted networks
  • Trade-off may add slight latency
How it works:
  1. DNS-MNS routes DNS queries through Passwall’s SOCKS proxy
  2. DNS queries go through the proxy tunnel
  3. Helps bypass DNS blocking and poisoning

Override Mode

In override mode, DNS-MNS takes over Passwall’s DNS configuration:
  • Use case when you want complete DNS control
  • Benefit unified DNS management
  • Trade-off Passwall’s built-in DNS is disabled
How it works:
  1. Passwall’s DNS configuration is disabled
  2. DNS-MNS becomes the primary DNS handler
  3. All DNS queries go through DNS-MNS

Prerequisites

  • OpenWrt 19.07+ with Passwall or Passwall2 installed
  • DNS-MNS v6.5.0+ installed on router
  • Passwall configured with at least one working proxy node

Installation

Step 1: Install DNS-MNS

Follow the OpenWrt Installation Guide to install DNS-MNS on your router.

Step 2: Verify Passwall Installation

If Passwall is not installed:

Step 3: Configure Integration

CLI Commands

Check Status

Shows:
  • Passwall variant (Passwall/Passwall2)
  • Installation and running status
  • DNS mode and filter mode
  • Integration mode
  • Recommendations

Configure Integration

Sync DNS Settings

This updates Passwall’s remote DNS with DNS-MNS’s best performing servers.

Gaming Optimization

Provides gaming-optimized DNS configuration based on:
  • Passwall’s current proxy mode
  • Network conditions
  • Gaming requirements

Restore Configuration

Restores the original configuration from backup.

Interactive Menu

Access Passwall integration through the interactive menu:
Select Option 11: Passwall Integration Menu options:
  1. Check Status - Show detailed Passwall integration status
  2. Configure Integration - Set up integration mode
  3. Gaming Optimization - Optimize DNS for gaming
  4. Sync DNS Settings - Sync with Passwall
  5. Restore Configuration - Restore original settings

Gaming with Passwall

Optimal Setup for Gaming

  1. Configure Passwall in Game Mode (if available)
  2. Use DNS-MNS Cooperative Mode
  3. Apply Gaming DNS

Troubleshooting

Passwall Not Detected

DNS Not Working After Configuration

Restore Original Configuration

Check Logs

Advanced Configuration

Custom DNS Servers

JSON Output

All commands support JSON output for scripting:

Integration with Auto-Benchmarking

Enable auto-benchmarking to automatically update Passwall DNS:

FAQ

Q: Which integration mode should I use?

A: For most users, Cooperative Mode is recommended:
  • Best performance
  • DNS and proxy handled separately
  • Lowest latency for gaming
Use Integrated Mode only if:
  • DNS is being blocked/poisoned
  • You’re in a heavily restricted network
  • You need DNS through proxy tunnel

Q: Will this affect my existing Passwall configuration?

A: DNS-MNS creates a backup before making changes. You can restore the original configuration with:

Q: Can I use Passwall without DNS-MNS?

A: Yes, Passwall works independently. DNS-MNS integration is optional but provides optimized DNS performance.

Q: Does this work with Passwall2?

A: Yes, DNS-MNS supports both Passwall (legacy) and Passwall2 (modern).

Q: What happens if I uninstall DNS-MNS?

A: Before uninstalling, run:
This restores the original Passwall configuration.

See Also