Skip to main content

OpenWrt Router Support

DNS-MNS now supports OpenWrt routers, allowing you to provide smart DNS resolution for your entire network. This is especially useful for Iranian users who want to bypass DNS censorship for all devices on their home network.

Overview

DNS-MNS on OpenWrt operates in two modes:

Upstream Mode (Recommended)

DNS-MNS works alongside dnsmasq. Dnsmasq stays on port 53 and forwards queries to DNS-MNS running on a different port.

Direct Mode

DNS-MNS replaces dnsmasq on port 53. Dnsmasq DNS is disabled, but DHCP continues to work.

Installation

Download the Correct Binary

OpenWrt runs on various architectures. Download the appropriate binary for your router:

Identify Your Router Architecture

SSH into your OpenWrt router and run:
Common outputs:
  • x86_64 → Use x86_64 binary
  • mips → Use MIPS binary
  • mipsel or mipsle → Use MIPSel binary
  • armv7l → Use ARM v7 binary
  • aarch64 → Use ARM64 binary

Install on OpenWrt

  1. Download to your computer, then copy to the router:
  1. SSH to router and install:
  1. Verify installation:

Configuration

Step 1: Detect OpenWrt

Verify DNS-MNS detects your OpenWrt system correctly:
Example output:

Step 2: Choose and Setup Mode

Step 3: Check Status

View the current configuration:
Example output:

Step 4: Enable Auto-Start

To start DNS-MNS automatically on boot:

Managing the Service

Start/Stop/Restart

View Logs

Restoring Original Configuration

If you need to revert to your original dnsmasq configuration:
This will:
  • Restore dnsmasq configuration from backup
  • Restart dnsmasq with original settings
  • Remove DNS-MNS configuration

CLI Commands Reference

Setup Flags

Troubleshooting

DNS-MNS Not Detecting OpenWrt

If dns-mns openwrt detect fails, verify:

Dnsmasq Fails to Start

If dnsmasq fails after configuration:

Port Already in Use

If port 5353 is already in use:

Low Memory on Router

For routers with limited RAM (< 64MB):

Building from Source for OpenWrt

To build a custom binary for your router:
Or use the Makefile:

Comparison with SmartDNS

Best Practices

  1. Start with Upstream Mode: It’s safer and allows easy rollback
  2. Backup Your Config: Before making changes, backup /etc/config/dhcp
  3. Test Before Auto-Start: Manually test DNS resolution before enabling auto-start
  4. Monitor Memory Usage: On low-end routers, monitor with free -h
  5. Use Dashboard: Run dns-mns dashboard to monitor performance