| نسخه فارسی |
This is the Android client for MasterDnsVPN. Before using this app, you must install and configure the server side from the main project first. The app will not work without a running MasterDnsVPN server.
Don't want to build from source? Download the latest pre-built APK directly from the Releases page.
| APK | Architecture | Use case |
|---|---|---|
...-arm64-v8a.apk |
ARM 64-bit | Most modern Android phones |
...-armeabi-v7a.apk |
ARM 32-bit | Older Android phones |
...-universal.apk |
Universal | When unsure |
MasterDnsVPN is a high-performance DNS-over-UDP tunnel that encrypts and routes your traffic through a remote server, bypassing censorship and surveillance. This repository contains the Android client app built on top of the same Go engine.
| Tool | Version | Download |
|---|---|---|
| Go | 1.22+ | https://go.dev/dl |
| Android Studio | Ladybug+ | https://developer.android.com/studio |
| Android SDK | API 26+ (target API 35) | via Android Studio SDK Manager |
| Android NDK | 27.x | via Android Studio SDK Manager |
| gomobile | latest | go install golang.org/x/mobile/cmd/gomobile@latest |
go install golang.org/x/mobile/cmd/gomobile@latest
gomobile init.\build_aar.ps1This script:
- Detects the installed NDK automatically
- Runs
gomobile bind→ buildsandroid/app/libs/masterdnsvpn.aar - Runs
gradlew assembleDebug→ produces the APK
| File | Path |
|---|---|
| Go AAR library | android/app/libs/masterdnsvpn.aar |
| Debug APK | android/app/build/outputs/apk/debug/ |
# Step 1 — Build AAR (arm64 only)
$env:GOFLAGS = "-mod=mod"
$env:ANDROID_HOME = "$env:USERPROFILE\AppData\Local\Android\Sdk"
$ndkVer = (Get-ChildItem "$env:ANDROID_HOME\ndk" | Sort-Object Name -Descending | Select-Object -First 1).Name
$env:ANDROID_NDK_HOME = "$env:ANDROID_HOME\ndk\$ndkVer"
gomobile bind -target android/arm64 -androidapi 26 -javapkg com.masterdnsvpn.gomobile `
-o "android\app\libs\masterdnsvpn.aar" masterdnsvpn-go/cmd/android
# Step 2 — Build APK
cd android
.\gradlew.bat assembleDebug
# Step 3 — Install on device
adb install "app\build\outputs\apk\debug\MasterDnsVPN-1.0.0-beta-arm64-v8a.apk"- Create / Edit / Delete profiles — each profile connects to one MasterDnsVPN server
- All client configuration fields exposed in the UI (server address, port, encryption, compression, DNS, SOCKS5, TUN mode, balancer strategy, MTU, etc.)
- Resolver editor — add/remove DNS resolvers per profile
- Tunnel mode per profile: SOCKS5 proxy or TUN (system-wide VPN)
- Groups multiple profiles under a single start/stop control
- Distributes connections across all sub-profiles using one of four strategies:
- RoundRobin — rotate in order
- Random — random selection
- LeastConn — pick proxy with fewest active connections
- LowestLatency — pick the fastest proxy
- Supports both SOCKS5 and TUN tunnel modes
- Uses Android
VpnServiceto capture all device traffic - tun2socks bridge (gVisor netstack): converts TCP/UDP flows to SOCKS5, forwards through the Go engine
- Per-app filtering: All apps / Include list / Exclude list
- Share VPN over Wi-Fi hotspot
- TCP relay on
0.0.0.0:8090→ shows address/port to configure on connected devices
- Real-time per-profile stats: resolver health, listen address, session state
- CPU / RAM / upload speed / download speed updated every second
- Per-profile cumulative data usage (persisted across restarts)
- Color-coded real-time log viewer
┌──────────────────────────────────────────────────────────┐
│ Android App (Kotlin + Compose) │
│ │
│ HomeScreen ──► HomeViewModel ──► TunnelController │
│ │ │
│ ┌─────────────┴──────────────┐ │
│ │ DnsTunnelVpnService (TUN) │ │
│ │ DnsTunnelProxyService │ │
│ └─────────────┬──────────────┘ │
│ │ │
│ GoMobileBridge (JNI) │
└──────────────────────────────────────────────────────────┘
│
┌───────────────▼──────────────────┐
│ Go Engine (masterdnsvpn.aar) │
│ StartInstance / StopInstance │
│ StartTunBridge (gVisor) │
│ StartSocksBalancer (meta) │
│ GetStats / GetBandwidth │
└──────────────────────────────────┘
Device apps → TUN fd → gVisor netstack → SOCKS5 (Go) → DNS tunnel → MasterDnsVPN server
Device apps → TUN fd → gVisor → SOCKS Balancer ─┬─ Profile-1 → server-1
├─ Profile-2 → server-2
└─ Profile-N → server-N
See LICENSE.
- Server & main project: github.com/masterking32/MasterDnsVPN
If you find this project useful, consider supporting its development:
| Network | Address |
|---|---|
| TON | UQBW_LoEhcYPIzZL_dzp-OMsqI5uAwv8p6dXy8wzzkPU-CQQ |
| BNB / USDT (BEP-20) | 0x951acaf8d4b61a000d3b5c697abcabf52973d0cf |
| TRX | TL4Kej6DjJmT9gQ5ghmQcvsEUHPdnNNPyj |
| SOL | 45kAfGyh13bcyYTdbNLkVfBGtMgq4WMijLgdBK9G9ugN |
