> ## Documentation Index
> Fetch the complete documentation index at: https://e-gurl.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Installation

> Install DNS-MNS on Windows, macOS, Linux, OpenWrt, or Android

# Installation

DNS-MNS can be installed on Windows, macOS, Linux, OpenWrt, and Android. Choose the method that works best for you.

## Pre-Built Binary (Recommended)

The easiest way to use DNS-MNS is to download the pre-built binary. No dependencies required -- just download and run.

<Note>
  This is the best option for users in Iran who cannot use `curl` or `wget` due to network restrictions. Just get the binary file and run it. No internet connection needed after download.
</Note>

1. Go to the [Releases page](https://gitlab.com/E-Gurl/dns-mns/-/releases)
2. Download the binary for your system:

| Platform              | File                        |
| --------------------- | --------------------------- |
| Windows (64-bit)      | `dns-mns-windows-amd64.exe` |
| macOS (Intel)         | `dns-mns-darwin-amd64`      |
| macOS (Apple Silicon) | `dns-mns-darwin-arm64`      |
| Linux (x86\_64)       | `dns-mns-linux-amd64`       |
| Linux (ARM64)         | `dns-mns-linux-arm64`       |

3. Run it:

<Tabs>
  <Tab title="Linux/macOS">
    ```bash theme={null}
    chmod +x dns-mns-linux-amd64
    ./dns-mns-linux-amd64
    ```
  </Tab>

  <Tab title="Windows">
    **Option 1: Use the PowerShell Wrapper (Recommended)**

    Download both files from the releases page:

    * `dns-mns-windows-amd64.exe`
    * `dns-mns-wrapper.ps1`

    Place them in the same folder and run:

    ```powershell theme={null}
    .\dns-mns-wrapper.ps1
    ```

    The wrapper automatically handles Administrator privileges.

    **Option 2: Run Directly**

    Double-click `dns-mns-windows-amd64.exe` or run from Command Prompt/PowerShell.

    <Note>
      Right-click and select "Run as administrator" to enable DNS configuration.
    </Note>
  </Tab>
</Tabs>

## One-Line Install

Install DNS-MNS with a single command. The installer automatically detects your OS and architecture, then downloads the correct pre-built binary.

<Tabs>
  <Tab title="curl">
    ```bash theme={null}
    curl -sSL https://gitlab.com/E-Gurl/dns-mns/-/raw/main/install.sh | bash
    ```
  </Tab>

  <Tab title="wget">
    ```bash theme={null}
    wget -qO- https://gitlab.com/E-Gurl/dns-mns/-/raw/main/install.sh | bash
    ```
  </Tab>
</Tabs>

The installer will:

* Detect your OS (Linux, macOS, Windows) and architecture (x86\_64, ARM64)
* Download the correct pre-built binary (same as the manual download -- no dependencies)
* Install it to `~/.local/bin/dns-mns`
* Add it to your PATH (you may need to restart your terminal)

## Manual Installation

If you cannot or do not want to use curl/wget, you can install manually.

### Option A: Download ZIP

1. Go to [gitlab.com/E-Gurl/dns-mns](https://gitlab.com/E-Gurl/dns-mns)
2. Click the **Code** button, then click **Download ZIP**
3. Extract the ZIP file to a folder on your computer
4. Find the binary for your platform in the extracted folder and run it:

```bash theme={null}
chmod +x dns-mns-linux-amd64
./dns-mns-linux-amd64
```

### Option B: Clone with Git

```bash theme={null}
git clone https://gitlab.com/E-Gurl/dns-mns.git
cd dns-mns
go build -ldflags="-s -w" -o dns-mns ./cmd/dns-mns/
./dns-mns
```

## Building from Source

If you want to build the Go binary yourself:

1. Install [Go](https://go.dev/dl/) (1.21 or newer)
2. Clone and build:

```bash theme={null}
git clone https://gitlab.com/E-Gurl/dns-mns.git
cd dns-mns
go build -ldflags="-s -w" -o dns-mns ./cmd/dns-mns/
```

Cross-compile for other platforms:

```bash theme={null}
# Windows
GOOS=windows GOARCH=amd64 go build -ldflags="-s -w" -o dns-mns.exe ./cmd/dns-mns/

# macOS (Apple Silicon)
GOOS=darwin GOARCH=arm64 go build -ldflags="-s -w" -o dns-mns-mac ./cmd/dns-mns/

# OpenWrt (statically linked)
make build-openwrt
```

## OpenWrt Router Installation

DNS-MNS can run directly on OpenWrt routers, providing smart DNS for your entire network.

### Supported Architectures

| Architecture | Download File             |
| ------------ | ------------------------- |
| x86\_64      | `dns-mns-openwrt-x86_64`  |
| MIPS         | `dns-mns-openwrt-mips`    |
| MIPSel       | `dns-mns-openwrt-mipsel`  |
| ARM v7       | `dns-mns-openwrt-armv7`   |
| ARM64        | `dns-mns-openwrt-aarch64` |

### Installation Steps

1. **Identify your router architecture:**
   ```bash theme={null}
   ssh root@192.168.1.1
   uname -m
   ```

2. **Download and install:**
   ```bash theme={null}
   # From your computer, copy the binary to router
   scp dns-mns-openwrt-x86_64 root@192.168.1.1:/tmp/

   # SSH to router and install
   ssh root@192.168.1.1
   mv /tmp/dns-mns-openwrt-x86_64 /usr/bin/dns-mns
   chmod +x /usr/bin/dns-mns
   ```

3. **Configure DNS-MNS:**
   ```bash theme={null}
   # Detect OpenWrt
   dns-mns openwrt detect

   # Setup (upstream mode recommended)
   dns-mns openwrt setup --mode upstream

   # Check status
   dns-mns openwrt status
   ```

4. **Enable auto-start:**
   ```bash theme={null}
   /etc/init.d/dns-mns enable
   /etc/init.d/dns-mns start
   ```

See the [OpenWrt Guide](/usage/openwrt) for detailed configuration options.

## Platform-Specific Requirements

<Note>
  The pre-built binary has **no dependencies**. Just download and run it.
</Note>

<Tabs>
  <Tab title="Linux">
    Most Linux systems have everything needed. If not, install these:

    **Ubuntu/Debian:**

    ```bash theme={null}
    sudo apt update
    sudo apt install curl ping gawk
    ```

    **Fedora:**

    ```bash theme={null}
    sudo dnf install curl iputils gawk
    ```

    **Arch Linux:**

    ```bash theme={null}
    sudo pacman -S curl iputils gawk
    ```
  </Tab>

  <Tab title="macOS">
    macOS has all required tools pre-installed. No additional installation needed.
  </Tab>

  <Tab title="Windows">
    The pre-built `.exe` binary runs natively on Windows. No additional tools needed.
  </Tab>
</Tabs>

## Updating to a Newer Version

<Tabs>
  <Tab title="Auto-Update (Recommended)">
    The easiest way to update -- the binary updates itself:

    ```bash theme={null}
    dns-mns update
    ```
  </Tab>

  <Tab title="Re-run Installer">
    Re-run the one-line installer to download and install the latest binary:

    ```bash theme={null}
    curl -sSL https://gitlab.com/E-Gurl/dns-mns/-/raw/main/install.sh | bash
    ```
  </Tab>

  <Tab title="Manual Download">
    1. Go to the [Releases page](https://gitlab.com/E-Gurl/dns-mns/-/releases)
    2. Download the binary for your platform
    3. Replace your existing binary (e.g., `~/.local/bin/dns-mns`)
    4. Make sure it's executable: `chmod +x dns-mns`
  </Tab>

  <Tab title="Git (Build from Source)">
    ```bash theme={null}
    cd /path/to/dns-mns
    git pull origin main
    go build -ldflags="-s -w" -o dns-mns ./cmd/dns-mns/
    ```
  </Tab>
</Tabs>

## Android (Beta)

<Warning>
  Android support is in **beta** (v0.0.4-beta). Expect rough edges. Feedback and bug reports are welcome.
</Warning>

DNS-MNS is available as a standalone APK for Android devices. No Play Store required.

### Supported Architectures

| Architecture | Devices                                                     |
| ------------ | ----------------------------------------------------------- |
| arm64-v8a    | Most modern phones (Pixel, Samsung Galaxy S/A series, etc.) |
| armeabi-v7a  | Older 32-bit ARM devices                                    |
| x86\_64      | Android emulators, ChromeOS                                 |
| x86          | Older Intel-based tablets                                   |

The universal APK includes all four architectures — one download works on all supported devices. Platform-specific APKs are also available for smaller download sizes.

### Installation Steps

1. Download the APK from the [Releases page](https://gitlab.com/E-Gurl/dns-mns/-/releases):
   * **Universal:** `dns-mns-android-0.0.4-beta.apk` (all architectures)
   * **Per-ABI:** `dns-mns-android-arm64-v8a-0.0.4-beta.apk`, `dns-mns-android-armeabi-v7a-0.0.4-beta.apk`, `dns-mns-android-x86_64-0.0.4-beta.apk`, `dns-mns-android-x86-0.0.4-beta.apk`
2. On your Android device, enable **Install from unknown sources**:
   * Android 8+: Settings > Apps > Special access > Install unknown apps
   * Older: Settings > Security > Unknown sources
3. Open the APK file and tap **Install**
4. Open **DNS-MNS** from the app drawer

### Features

* **VPN-based DNS tunnel** — routes DNS queries through a local VPN for system-wide coverage
* **One-tap configuration** — tap Connect to start, tap Disconnect to stop
* **Light/dark mode** — toggle between themes with persistent preference

<Note>
  The Android app does not require root access. It uses Android's VPN API to intercept and route DNS traffic.
</Note>

## Uninstalling

**Binary (installed via download or one-line installer):**

```bash theme={null}
rm -f ~/.local/bin/dns-mns
```

## Verifying Installation

After installation, verify that DNS-MNS is working:

```bash theme={null}
dns-mns
```

You should see the main menu:

```
[ MAIN MENU ]

  [1]  Test Gaming DNS
  [2]  Set Custom DNS
  [3]  Clear/Reset DNS
  [4]  Test DoH/DoT DNS
  [5]  Help & About
  [6]  Test DNSCrypt
  [7]  DNSCrypt Proxy
  [8]  DoH/DoT Proxy
  [9]  DNS Censorship Check
  [10] Smart Proxy (Auto-Fallback)
  [0]  Exit

Enter your choice [0-10]:
```

<Note>
  If you see "Command not found: dns-mns", try restarting your terminal or run directly: `~/.local/bin/dns-mns`
</Note>
