Interactive DNS Tunnel Setup Wizard — automated server deployment for unrestricted internet access.
Deploys dnstm DNS tunnel servers with Slipstream and DNSTT protocols. Designed to help people in restricted regions stay connected to the free internet.
- 🔍 How DNS Tunneling Works
- 🏗️ Architecture
- 📦 What Gets Installed
- ✅ Prerequisites
- 🚀 Quick Start
- 📋 Setup Steps Explained
- 🌍 DNS Records Guide
- ⌨️ Usage
- ❓ In-TUI Help System
- 📱 Client Apps
- 🛠️ Management Commands
- 👤 SSH Tunnel User Management
- 🔐 SOCKS Proxy Authentication
- 🗑️ Uninstall
- 📖 Manual Setup Guide
- 🔧 Troubleshooting
- 🙏 Acknowledgments
- 🔗 Related Projects
- 💖 Donate
- 📄 License
- 👤 Author
- 📖 راهنمای فارسی
DNS (Domain Name System) is the internet's phone book — every device on the planet needs it to work. DNS tunneling encodes your internet traffic inside DNS queries and responses.
💡 Why DNS? Censors can block VPNs, Tor, and direct connections, but they almost never block DNS because doing so would break the internet for everyone. Even during total internet shutdowns, DNS queries often still work through ISP resolvers.
How it works:
- 📱 Your phone (running SlipNet) encodes internet traffic as DNS queries
- 🔒 These queries look like normal DNS lookups (e.g.,
abc123.t2.yourdomain.com) - 🌍 The queries travel through public DNS resolvers (Google
8.8.8.8, Cloudflare1.1.1.1, etc.) - 🖥️ Your server receives the queries, decodes the hidden data, and forwards it to the real internet
- ↩️ Responses travel back the same way, encoded inside DNS responses
Because the traffic looks like ordinary DNS resolution, it passes through filters undetected.
📱 Phone (SlipNet App)
|
| DNS queries (encoded traffic)
v
🌍 Public DNS Resolver (8.8.8.8 / 1.1.1.1 / 9.9.9.9)
|
| DNS delegation (NS records point to your server)
v
🖥️ Your Server — Port 53
|
v
🔀 DNS Router (multiplexes port 53)
|
+---> t2.domain ---> Slipstream ---> microsocks (SOCKS5) ---> 🌐 Internet
| (QUIC + TLS)
|
+---> d2.domain ---> DNSTT --------> microsocks (SOCKS5) ---> 🌐 Internet
| (Noise + Curve25519)
|
+---> s2.domain ---> Slipstream ---> SSH Tunnel ------------> 🌐 Internet
| (QUIC + TLS) (port forwarding)
|
+---> ds2.domain --> DNSTT --------> SSH Tunnel ------------> 🌐 Internet
(Noise + Curve25519) (port forwarding)
When someone queries t2.yourdomain.com, the global DNS system follows this chain:
- Client asks its resolver: "What is xyz.t2.yourdomain.com?"
- Resolver asks Cloudflare (your domain's nameserver): "What is t2.yourdomain.com?"
- Cloudflare sees the NS record: "For t2.yourdomain.com, ask ns.yourdomain.com"
- Cloudflare sees the A record: "ns.yourdomain.com is at
<your server IP>" - Resolver sends the query directly to your server on port 53
- Your server's DNS Router receives it and routes to the correct tunnel
This is why you need both an A record (telling the internet where your server is) and NS records (delegating subdomains to your server).
| Component | Description | Details |
|---|---|---|
| 🎛️ dnstm | DNS Tunnel Manager | CLI tool that manages all tunnel binaries, services, and routing |
| 🔀 DNS Router | Port 53 multiplexer | Inspects incoming DNS queries and routes them to the correct tunnel by subdomain |
| ⚡ Slipstream Server | QUIC-based DNS tunnel | TLS encryption with self-signed certificates — Speed: ~63 KB/s |
| 🔐 DNSTT Server | Classic DNS tunnel | Noise protocol with Curve25519 key pairs — Speed: ~42 KB/s |
| 🧦 microsocks | SOCKS5 proxy | Lightweight proxy shared by all tunnels (port auto-assigned by dnstm) |
| 👤 sshtun-user | SSH user manager | (Optional) Creates restricted users that can only do port forwarding |
| Tunnel | Subdomain | Transport | Backend | Use Case |
|---|---|---|---|---|
| ⚡ slip1 | t2.domain |
Slipstream (QUIC) | SOCKS | Fastest — recommended for most users |
| 🔐 dnstt1 | d2.domain |
DNSTT (Noise) | SOCKS | Fallback if Slipstream is blocked |
| 🔑 slip-ssh | s2.domain |
Slipstream (QUIC) | SSH | When you need per-user authentication |
| 🔑 dnstt-ssh | ds2.domain |
DNSTT (Noise) | SSH | SSH fallback if Slipstream is blocked |
🧦 SOCKS backend: Optionally secured with SOCKS5 username/password authentication. Without auth, anyone who knows the domain can connect.
🔑 SSH backend: Requires username + password. Provides per-user access control. The SSH user is restricted — even if credentials leak, no one can access your server.
Before running the script, you need:
- Running Ubuntu or Debian (tested on Ubuntu 20.04 / 22.04 / 24.04)
- Root access (SSH as root or sudo)
- Public IPv4 address
- Port 53 (UDP + TCP) open in any external firewall / hosting provider panel
- Any domain works (cheap TLDs like
.live,.xyzare fine) - The domain must use Cloudflare DNS (free plan) to manage records
- You can buy domains from Namecheap, Cloudflare Registrar, or any registrar
- Usually pre-installed on Ubuntu/Debian
- If missing, the script will offer to install it for you
SSH into your server as root, then:
curl -fsSL -o dnstm-setup.sh https://raw.githubusercontent.com/SamNet-dev/dnstm-setup/master/dnstm-setup.sh
sudo bash dnstm-setup.sh💡 Tip: Press h at any prompt for detailed help on that step.
Already set up? Add another domain to the same server as a fallback:
sudo bash dnstm-setup.sh --add-domainThis creates a new set of tunnels on the same server with a different domain. If one domain gets blocked, the other still works.
The wizard has 12 steps. Here's what each one does:
Step 1 — ✅ Pre-flight Checks
- Verifies you're running as root
- Checks the OS is Ubuntu/Debian
- Ensures
curlis installed (offers to install if missing) - Auto-detects your server's public IP via
api.ipify.org
Step 2 — 🌐 Domain Configuration
- Asks for your domain name (e.g.
example.com) - Strips whitespace,
http://, and trailing slashes automatically - Validates the domain contains at least one dot
Step 3 — 📝 DNS Records (Cloudflare)
- Shows you exactly which DNS records to create in Cloudflare
- Displays a formatted box with all 5 records (1 A + 4 NS)
- Explains why "DNS Only" (grey cloud) is required
- Waits for your confirmation before proceeding
Step 4 — 🔓 Free Port 53
- Checks if anything is already using port 53
- Detects
systemd-resolvedby both process name and127.0.0.53address - Offers to disable it and set DNS to
8.8.8.8(Google DNS) - If dnstm is already on port 53 (re-run), skips this step
- Verifies port 53 is actually free after changes
Step 5 — 📥 Install dnstm
- Downloads the dnstm binary from GitHub releases
- Runs
dnstm install --mode multito set up multi-tunnel mode - If dnstm is already installed, asks if you want to re-install/update
- Installs: tunnel binaries, system user, firewall rules, DNS Router, microsocks
Step 6 — 🔍 Verify Port 53
- Confirms the DNS Router is listening on port 53
- If not, attempts to start it
- Opens port 53 TCP/UDP in ufw and iptables (if present)
- Reminds you to check external firewalls (hosting provider panel)
Step 7 — 🚇 Create Tunnels
- Asks for DNSTT MTU size (default 1232, range 512–1400) — useful for networks with packet size restrictions
- Creates 4 tunnels using
dnstm tunnel add:slip1— Slipstream + SOCKS ont2.yourdomain.comdnstt1— DNSTT + SOCKS ond2.yourdomain.com(with configurable MTU)slip-ssh— Slipstream + SSH ons2.yourdomain.comdnstt-ssh— DNSTT + SSH onds2.yourdomain.com(with configurable MTU)
- Extracts and displays the DNSTT public key (needed for client config)
- Handles "already exists" gracefully on re-runs
Step 8 — ▶️ Start Services
- Starts the DNS Router
- Starts all 4 tunnels
- Shows current tunnel status via
dnstm tunnel list - Handles "already running" gracefully
Step 9 — 🧦 Verify SOCKS Proxy
- Asks if you want SOCKS5 authentication — recommended for security
- If yes: prompts for username (default:
proxy) and password - Configures auth via
dnstm backend auth(dnstm v0.6.8+) - If no: proxy runs open (anyone who knows the domain can connect)
- If yes: prompts for username (default:
- Checks if microsocks is running (process or systemd service)
- Starts it if not running
- Tests the SOCKS proxy by detecting the microsocks port and making a request through it
Step 10 — 👤 SSH Tunnel User
- Required for SSH tunnels (s2/ds2) to work — skipping means SSH tunnels won't function
- Downloads
sshtun-usertool if not installed - Configures SSH with security restrictions
- Creates a restricted user that can only do SSH port forwarding
- Asks for username (default: "tunnel") and password
- Shows how to create one later if skipped
Step 11 — 🧪 Verification Tests
Runs 6 automated tests:
- SOCKS proxy — HTTP request through microsocks
- Tunnel status — Checks all tunnels are running
- DNS Router — Verifies router is active
- Port 53 — Confirms dnstm is on port 53
- DNS delegation — End-to-end reachability via public resolvers
- SSH readiness — Verifies sshd is running and tunnel user was created
Step 12 — 📊 Summary
Displays everything you need:
- Server IP and domain
- All 4 tunnel endpoints
- DNSTT public key
dnst://share URLs for dnstc CLI clientslipnet://deep-link URLs for SlipNet Android app (tap to import) — includes SOCKS credentials when auth is enabled- SOCKS proxy credentials (if authentication was enabled) or warning if open
- SSH tunnel credentials (if configured) or warning if not set up
- List of DNS resolvers for SlipNet
- Client app download link
- Useful management commands
Create these records in your Cloudflare dashboard:
| Field | Value |
|---|---|
| Type | A |
| Name | ns |
| IPv4 address | Your server's IP (e.g. 198.23.249.154) |
| Proxy status | DNS Only (grey cloud — click to toggle OFF) |
☝️ This tells the internet: "ns.yourdomain.com is at this IP address."
| Type | Name | Target |
|---|---|---|
NS |
t2 |
ns.yourdomain.com |
NS |
d2 |
ns.yourdomain.com |
NS |
s2 |
ns.yourdomain.com |
NS |
ds2 |
ns.yourdomain.com |
☝️ These tell the internet: "For queries about t2/d2/s2/ds2.yourdomain.com, ask ns.yourdomain.com (your server)."
| Mistake | Why it breaks |
|---|---|
Using tns instead of ns |
The A record name must be exactly ns |
| Leaving Cloudflare proxy ON 🟠 | Must be DNS Only (grey cloud ⚪) — orange cloud intercepts queries |
| Setting NS value to an IP | NS records must point to a hostname (ns.yourdomain.com), not an IP |
| Forgetting to save | Click Save after adding each record! |
# 🚀 Run the interactive setup wizard (first time)
sudo bash dnstm-setup.sh
# 🎛️ Post-setup management menu (all actions in one place)
sudo bash dnstm-setup.sh --manage
# 🔧 Set custom DNSTT MTU (default: 1232, range: 512-1400)
sudo bash dnstm-setup.sh --mtu 1200
# 🌐 Add a backup domain with custom MTU
sudo bash dnstm-setup.sh --add-domain --mtu 1200
# 🚇 Add a single tunnel (interactive)
sudo bash dnstm-setup.sh --add-tunnel
# ❌ Remove a specific tunnel (interactive picker)
sudo bash dnstm-setup.sh --remove-tunnel
# Or specify the tag directly
sudo bash dnstm-setup.sh --remove-tunnel slip1
# 👤 Manage SSH tunnel users (add, list, update, delete)
sudo bash dnstm-setup.sh --users
# 📊 Show all tunnels, credentials, and share URLs
sudo bash dnstm-setup.sh --status
# 🗑️ Remove ALL installed components (nuclear option)
sudo bash dnstm-setup.sh --uninstall
# ❓ Show help (no root needed)
bash dnstm-setup.sh --help
# ℹ️ Show project information (no root needed)
bash dnstm-setup.sh --aboutPress h at any prompt during the interactive setup to open the help menu:
┌──────────────────────────────────────────────────────────┐
│ Help — Pick a Topic │
└──────────────────────────────────────────────────────────┘
1 Domains & DNS Basics
2 DNS Records (Cloudflare Setup)
3 Port 53 & systemd-resolved
4 dnstm — DNS Tunnel Manager
5 SSH Tunnel Users
6 Architecture & How It Works
────────────────────────────────────────
7 About
Pick a topic (1-7) or Enter to go back:
Each topic gives deep explanations of how things work, why each step is needed, and what the terminology means. Browse multiple topics and return to the setup prompt when ready.
SlipNet supports both Slipstream and DNSTT tunnels.
📥 Download: https://github.com/anonvector/SlipNet/releases
| Setting | Value |
|---|---|
| 🌐 Domain | Your tunnel subdomain (e.g. t2.yourdomain.com) |
| 🔍 DNS Resolver | Any public resolver (see below) |
| 🔄 Transport | Slipstream (for t2/s2) or DNSTT (for d2) |
| 🔑 DNSTT Public Key | The key shown in Step 7 (only for d2 tunnel) |
HTTP Injector supports DNSTT tunnels (the d2 subdomain). Slipstream is not supported on iOS.
📥 Download: App Store
| Setting | Value |
|---|---|
| 🔄 Protocol | DNS Tunnel (DNSTT) |
| 🌐 Domain | d2.yourdomain.com |
| 🔍 DNS Resolver | Any public resolver (see below) |
| 🔑 DNSTT Public Key | The key shown in Step 7 |
⚠️ iOS users can only use the DNSTT tunnel (d2subdomain). Slipstream tunnels (t2/s2) are Android-only via SlipNet.
| Platform | App | Slipstream (t2/s2) | DNSTT (d2) |
|---|---|---|---|
| 🤖 Android | SlipNet | ✅ | ✅ |
| 🍎 iOS | HTTP Injector | ❌ | ✅ |
The setup generates two types of share URLs for easy client configuration:
| URL Scheme | App | How to Use |
|---|---|---|
dnst:// |
dnstc (CLI client) | Import with dnstc tunnel import dnst://... |
slipnet:// |
SlipNet (Android) | Tap the link on your phone — opens SlipNet and imports the profile automatically |
dnst://URLs are generated bydnstm tunnel shareand contain JSON-encoded tunnel configslipnet://URLs are generated by the setup script and contain all fields SlipNet needs (domain, resolver, public key, SSH credentials)- HTTP Injector (iOS) does not support URL import — configure manually using the settings above
💡 The easiest way to set up a client is to copy a
slipnet://link from the server summary and open it on your Android phone — SlipNet will import everything automatically.
| Provider | IP | Note |
|---|---|---|
8.8.8.8:53 |
Most widely available | |
| 🟠 Cloudflare | 1.1.1.1:53 |
Fast, privacy-focused |
| 🟣 Quad9 | 9.9.9.9:53 |
Security-focused |
| 🔴 OpenDNS | 208.67.222.222:53 |
Cisco-backed |
| 🟢 AdGuard | 94.140.14.14:53 |
Ad-blocking DNS |
| 🔵 CleanBrowsing | 185.228.168.9:53 |
Family-safe DNS |
💡 Try different resolvers if one doesn't work in your region. Some ISPs may block specific resolvers.
After setup, manage your tunnels with these commands:
# 🎛️ Interactive management menu (all actions below in one menu)
sudo bash dnstm-setup.sh --manage
# 📊 Show everything: tunnels, credentials, share URLs (all in one)
sudo bash dnstm-setup.sh --status
# 🚇 Add a single tunnel (interactive — pick transport, backend, domain, tag)
sudo bash dnstm-setup.sh --add-tunnel
# ❌ Remove a specific tunnel (interactive picker or pass tag directly)
sudo bash dnstm-setup.sh --remove-tunnel
sudo bash dnstm-setup.sh --remove-tunnel slip1
# 📋 View all tunnels and their status
dnstm tunnel list
# 🔗 Generate share URLs for a tunnel
# dnst:// URLs (for dnstc CLI client):
dnstm tunnel share -t slip1
dnstm tunnel share -t dnstt-ssh --user tunnel --password secret
# slipnet:// URLs (for SlipNet Android app) are generated automatically
# in the setup summary — tap the link on your phone to import the profile
# 📊 Check DNS Router status
dnstm router status
# 📜 View DNS Router logs
dnstm router logs
# 🔍 View logs for a specific tunnel
dnstm tunnel logs --tag slip1
dnstm tunnel logs --tag dnstt1
dnstm tunnel logs --tag slip-ssh
# ⏹️ Stop / ▶️ Start a specific tunnel
dnstm tunnel stop --tag slip1
dnstm tunnel start --tag slip1
# 🔀 Stop / Start the DNS Router
dnstm router stop
dnstm router start
# 🧪 Test the SOCKS proxy locally (check port with: ss -tlnp | grep microsocks)
# Without authentication:
curl --socks5 127.0.0.1:<MICROSOCKS_PORT> https://api.ipify.org
# With SOCKS5 authentication:
curl --socks5-basic --proxy socks5://127.0.0.1:<MICROSOCKS_PORT> --proxy-user user:pass https://api.ipify.orgManage SSH tunnel users after setup with the built-in user management TUI:
sudo bash dnstm-setup.sh --usersThis opens an interactive menu:
| Option | Action |
|---|---|
| 1 | List users — show all SSH tunnel users |
| 2 | Add user — create a new tunnel user (with password or auto-generated) |
| 3 | Change password — update an existing user's password |
| 4 | Delete user — remove a user (with confirmation) |
| 0 | Exit |
What are SSH tunnel users? These are restricted system users that can only create SSH tunnels (SOCKS proxy, port forwarding) — they have no shell access and cannot run commands on your server. They're required for the SSH-based tunnels (
s2andds2subdomains).
If sshtun-user is not installed, the script will automatically download and configure it on first run.
During setup (Step 9), the wizard asks whether to enable SOCKS5 authentication on the microsocks proxy. This controls access to the SOCKS tunnels (t2 and d2 subdomains).
When enabled, microsocks requires a username and password for every SOCKS5 connection. This means:
- Only clients with the correct credentials can use the tunnel
- The
slipnet://share URLs automatically include the credentials (clients auto-configure) - The
authModefield in SlipNet is set to1(username/password)
Authentication is configured via dnstm backend auth (requires dnstm v0.6.8+).
When disabled, the proxy is open — anyone who can resolve the DNS tunnel domain can connect. Security relies solely on the domain being secret.
To add or change authentication:
sudo dnstm backend auth -t socks -u youruser -p yourpasswordTo remove authentication:
sudo dnstm backend auth -t socks --disableNote: When adding a backup domain with
--add-domain, the script auto-detects existing SOCKS authentication viadnstm backend statusand includes the credentials in the generated share URLs.
To remove everything installed by this script:
sudo bash dnstm-setup.sh --uninstallRemoves:
- ✅ All dnstm tunnels and the DNS Router
- ✅ dnstm binary and
/etc/dnstmconfiguration - ✅ sshtun-user binary (if installed)
- ✅ microsocks service
Not removed (must be done manually):
⚠️ DNS records in Cloudflare — delete them from your dashboard⚠️ systemd-resolved — re-enable with:chattr -i /etc/resolv.conf 2>/dev/null rm /etc/resolv.conf && ln -s ../run/systemd/resolve/stub-resolv.conf /etc/resolv.conf systemctl unmask systemd-resolved.socket systemd-resolved.service systemctl enable systemd-resolved && systemctl start systemd-resolved
If you prefer to set things up manually step by step (without this script), follow the complete manual guide:
📝 Complete Guide to Setting Up a DNS Tunnel (Farsi)
🔴 Port 53 is still in use after disabling systemd-resolved
# Check what's using port 53
ss -ulnp | grep -E ':53\b'
# If systemd-resolved is still there, force it (stop socket too!)
systemctl stop systemd-resolved.socket systemd-resolved.service
systemctl disable systemd-resolved.socket systemd-resolved.service
systemctl mask systemd-resolved.socket systemd-resolved.service
pkill -9 systemd-resolve
# Fix resolv.conf (remove symlink, write real file, lock it)
chattr -i /etc/resolv.conf 2>/dev/null; rm -f /etc/resolv.conf
echo "nameserver 8.8.8.8" > /etc/resolv.conf
chattr +i /etc/resolv.conf🔴 Tunnels not starting
# Check tunnel status
dnstm tunnel list
# Check logs for errors
dnstm tunnel logs --tag slip1
dnstm router logs
# Try restarting
dnstm router stop
dnstm router start
dnstm tunnel start --tag slip1🔴 SOCKS proxy not responding
# Check if microsocks is running
systemctl status microsocks
# Restart it
systemctl restart microsocks
# Test locally (check port with: ss -tlnp | grep microsocks)
curl --socks5 127.0.0.1:<MICROSOCKS_PORT> https://api.ipify.org🔴 DNS records not working
- Make sure the A record name is exactly
ns(nottns, notns1) - Make sure the A record proxy is OFF (grey cloud ⚪, not orange 🟠)
- NS record values must be
ns.yourdomain.com(not an IP address) - Wait 5–10 minutes for DNS propagation after creating records
- Test with:
dig NS t2.yourdomain.com— should showns.yourdomain.com
🔴 SlipNet can't connect
- Try different DNS resolvers (
8.8.8.8,1.1.1.1,9.9.9.9) - Make sure you selected the correct transport (Slipstream for t2/s2, DNSTT for d2)
- For DNSTT, verify the public key matches the one shown during setup
- Check that port 53 UDP and TCP are open in your hosting provider's firewall panel
This project builds on the incredible work of these open-source projects:
| Protocol | Author | Repository | Description |
|---|---|---|---|
| 🔐 DNSTT | David Fifield | bamsoftware.com/software/dnstt | DNS tunnel using Noise protocol with Curve25519 encryption. Supports UDP DNS, DoH, and DoT. |
| ⚡ Slipstream | EndPositive | EndPositive/slipstream | High-performance covert channel over DNS, powered by QUIC multipath with adaptive congestion control. |
Thank you to David Fifield and EndPositive for making internet freedom possible through their research and open-source contributions. 🫡
| Project | Description |
|---|---|
| 🎛️ dnstm | DNS Tunnel Manager CLI |
| 👤 sshtun-user | Restricted SSH tunnel user manager |
| 📱 SlipNet | Android VPN client for DNS tunnels |
If this project helps you or someone you know access the free internet, consider supporting continued development:
MIT
Made By SamNet Technologies — Saman
🔗 https://github.com/SamNet-dev
ابزار نصب تعاملی (Interactive) برای راهاندازی سرور تانل DNS جهت دسترسی به اینترنت آزاد. این اسکریپت تمام مراحل نصب و پیکربندی را به صورت خودکار انجام میدهد.
تانل DNS روشی برای عبور ترافیک اینترنت از طریق درخواستهای DNS است. از آنجا که DNS تقریباً هرگز مسدود نمیشود (حتی در زمان قطعی اینترنت)، این تکنولوژی یک کانال قابل اعتماد برای دسترسی به اینترنت فراهم میکند.
💡 چرا DNS؟ سانسورکنندگان میتوانند VPN، Tor و اتصالات مستقیم را مسدود کنند، اما تقریباً هرگز DNS را مسدود نمیکنند زیرا این کار اینترنت را برای همه خراب میکند.
نحوه عملکرد:
- 📱 گوشی شما (با اپلیکیشن SlipNet) ترافیک اینترنت را به صورت درخواستهای DNS رمزگذاری میکند
- 🔒 این درخواستها مانند جستجوی DNS معمولی به نظر میرسند
- 🌍 درخواستها از طریق DNS resolverهای عمومی (مانند 8.8.8.8) عبور میکنند
- 🖥️ سرور شما درخواستها را دریافت، رمزگشایی و به اینترنت واقعی ارسال میکند
- ↩️ پاسخها به همین روش برمیگردند
📱 گوشی (اپلیکیشن SlipNet)
|
| درخواستهای DNS (ترافیک رمزگذاری شده)
v
🌍 DNS Resolver عمومی (8.8.8.8 / 1.1.1.1)
|
v
🖥️ سرور شما — پورت 53
|
v
🔀 DNS Router (مالتیپلکسر)
|
+---> t2.domain ---> Slipstream ---> microsocks (SOCKS5) ---> 🌐 اینترنت
+---> d2.domain ---> DNSTT --------> microsocks (SOCKS5) ---> 🌐 اینترنت
+---> s2.domain ---> Slip+SSH -----> تانل SSH --------------> 🌐 اینترنت
+---> ds2.domain --> DNSTT+SSH ----> تانل SSH --------------> 🌐 اینترنت
- سیستمعامل Ubuntu یا Debian
- دسترسی root (SSH به عنوان root)
- آدرس IP عمومی (IPv4)
- پورت 53 (UDP و TCP) در فایروال باز باشد
- هر دامنهای قابل استفاده است (دامنههای ارزان مثل
.live،.xyzکافی هستند) - دامنه باید از Cloudflare DNS استفاده کند (پلن رایگان)
- میتوانید دامنه را از Namecheap یا هر ثبتکنندهای بخرید
- معمولاً روی Ubuntu/Debian نصب است
- اگر نصب نباشد، اسکریپت پیشنهاد نصب خودکار میدهد
وارد سرور خود شوید (SSH) و دستورات زیر را اجرا کنید:
curl -fsSL -o dnstm-setup.sh https://raw.githubusercontent.com/SamNet-dev/dnstm-setup/master/dnstm-setup.sh
sudo bash dnstm-setup.sh💡 در هر مرحله کلید h را بزنید تا راهنمای کامل آن بخش نمایش داده شود.
اگر قبلاً نصب انجام شده، میتوانید دامنه دیگری به همان سرور اضافه کنید:
sudo bash dnstm-setup.sh --add-domainاگر یک دامنه مسدود شود، دامنه دیگر همچنان کار میکند.
بعد از نصب، میتوانید کاربران تانل SSH رو مدیریت کنید:
sudo bash dnstm-setup.sh --usersاین رکوردها را در داشبورد Cloudflare ایجاد کنید:
| فیلد | مقدار |
|---|---|
| Type | A |
| Name | ns |
| IPv4 | آدرس IP سرور شما |
| Proxy | DNS Only (ابر خاکستری ⚪ — نه نارنجی 🟠!) |
| Type | Name | Target |
|---|---|---|
NS |
t2 |
ns.yourdomain.com |
NS |
d2 |
ns.yourdomain.com |
NS |
s2 |
ns.yourdomain.com |
NS |
ds2 |
ns.yourdomain.com |
| اشتباه | چرا خراب میکند |
|---|---|
استفاده از tns به جای ns |
نام رکورد A باید دقیقاً ns باشد |
| روشن بودن پروکسی Cloudflare 🟠 | باید خاموش باشد (ابر خاکستری ⚪) |
| قرار دادن IP به جای دامنه | مقدار NS باید ns.yourdomain.com باشد نه آدرس IP |
| فراموش کردن ذخیره | بعد از هر رکورد حتماً Save بزنید! |
اسکریپت شامل ۱۲ مرحله است:
- ✅ بررسیهای اولیه — root بودن، سیستمعامل، curl، شناسایی IP سرور
- 🌐 پیکربندی دامنه — وارد کردن نام دامنه
- 📝 رکوردهای DNS — نمایش رکوردهای مورد نیاز و تأیید ایجاد آنها
- 🔓 آزادسازی پورت 53 — غیرفعال کردن systemd-resolved در صورت نیاز
- 📥 نصب dnstm — دانلود و نصب مدیر تانل DNS
- 🔍 بررسی پورت 53 — تأیید اینکه DNS Router روی پورت 53 گوش میدهد
- 🚇 ایجاد تانلها — تنظیم MTU و ساخت ۴ تانل (Slipstream+SOCKS، DNSTT+SOCKS، Slipstream+SSH، DNSTT+SSH)
▶️ شروع سرویسها — راهاندازی روتر و تمام تانلها- 🧦 بررسی پروکسی SOCKS — انتخاب فعالسازی احراز هویت SOCKS5 (نام کاربری/رمز عبور)، تست microsocks (تشخیص خودکار پورت)
- 👤 کاربر SSH — ایجاد کاربر محدود برای تانل SSH (بدون آن تانلهای SSH کار نمیکنند)
- 🧪 تستهای نهایی — ۶ تست خودکار برای تأیید عملکرد
- 📊 خلاصه — نمایش تمام اطلاعات اتصال، اطلاعات احراز هویت SOCKS، لینکهای dnst:// (برای dnstc) و slipnet:// (برای اپ SlipNet)
| تانل | سابدامین | پروتکل | سرعت | توضیح |
|---|---|---|---|---|
| ⚡ Slipstream + SOCKS | t2 |
QUIC + TLS | ~63 KB/s | سریعترین — پیشنهادی برای اکثر کاربران |
| 🔐 DNSTT + SOCKS | d2 |
Noise + Curve25519 | ~42 KB/s | جایگزین اگر Slipstream مسدود شود |
| 🔑 Slipstream + SSH | s2 |
QUIC + TLS + SSH | ~60 KB/s | نیاز به نام کاربری و رمز عبور |
| 🔑 DNSTT + SSH | ds2 |
Noise + Curve25519 + SSH | ~40 KB/s | جایگزین SSH اگر Slipstream مسدود شود |
🧦 بکاند SOCKS: امکان فعالسازی احراز هویت SOCKS5 با نام کاربری و رمز عبور. بدون احراز هویت، هر کسی که دامنه را بداند میتواند وصل شود.
🔑 بکاند SSH: نیاز به نام کاربری و رمز عبور. حتی اگر رمز لو برود، کاربر فقط میتواند تانل بزند و دسترسی shell ندارد.
SlipNet از هر دو پروتکل Slipstream و DNSTT پشتیبانی میکند.
📥 دانلود: https://github.com/anonvector/SlipNet/releases
| تنظیم | مقدار |
|---|---|
| 🌐 Domain | سابدامین تانل (مثلاً t2.yourdomain.com) |
| 🔍 DNS Resolver | یکی از resolverهای عمومی (جدول زیر) |
| 🔄 Transport | Slipstream (برای t2/s2) یا DNSTT (برای d2) |
| 🔑 DNSTT Public Key | کلید نمایش داده شده در مرحله ۷ (فقط برای تانل d2) |
HTTP Injector فقط از تانل DNSTT (سابدامین d2) پشتیبانی میکند. Slipstream روی iOS پشتیبانی نمیشود.
📥 دانلود: App Store
| تنظیم | مقدار |
|---|---|
| 🔄 Protocol | DNS Tunnel (DNSTT) |
| 🌐 Domain | d2.yourdomain.com |
| 🔍 DNS Resolver | یکی از resolverهای عمومی (جدول زیر) |
| 🔑 DNSTT Public Key | کلید نمایش داده شده در مرحله ۷ |
⚠️ کاربران iOS فقط میتوانند از تانل DNSTT (سابدامینd2) استفاده کنند. تانلهای Slipstream (t2/s2) فقط روی اندروید با SlipNet کار میکنند.
| پلتفرم | اپلیکیشن | Slipstream (t2/s2) | DNSTT (d2) |
|---|---|---|---|
| 🤖 اندروید | SlipNet | ✅ | ✅ |
| 🍎 iOS | HTTP Injector | ❌ | ✅ |
اسکریپت دو نوع لینک اشتراکگذاری تولید میکند:
| نوع لینک | اپلیکیشن | نحوه استفاده |
|---|---|---|
dnst:// |
dnstc (کلاینت خط فرمان) | وارد کردن با dnstc tunnel import dnst://... |
slipnet:// |
SlipNet (اندروید) | روی لینک بزنید — اپ باز میشه و پروفایل خودکار اضافه میشه |
- لینکهای
dnst://توسط دستورdnstm tunnel shareتولید میشوند و شامل اطلاعات JSON تانل هستند - لینکهای
slipnet://توسط اسکریپت تولید میشوند و شامل تمام اطلاعات مورد نیاز SlipNet هستند (دامنه، resolver، کلید عمومی، اطلاعات SSH) - HTTP Injector (iOS) از لینک پشتیبانی نمیکند — تنظیمات را دستی وارد کنید
💡 سادهترین راه: لینک
slipnet://را از خلاصه سرور کپی کنید و روی گوشی اندرویدتان باز کنید — SlipNet همه چیز را خودکار وارد میکند.
| ارائهدهنده | آدرس | توضیح |
|---|---|---|
8.8.8.8:53 |
پراستفادهترین | |
| 🟠 Cloudflare | 1.1.1.1:53 |
سریع و خصوصی |
| 🟣 Quad9 | 9.9.9.9:53 |
امنیتمحور |
| 🔴 OpenDNS | 208.67.222.222:53 |
پشتیبانی Cisco |
| 🟢 AdGuard | 94.140.14.14:53 |
مسدودکننده تبلیغات |
| 🔵 CleanBrowsing | 185.228.168.9:53 |
مناسب خانواده |
💡 اگر یک resolver کار نکرد، resolverهای دیگر را امتحان کنید. بعضی ISPها ممکن است برخی resolverها را مسدود کنند.
بعد از نصب، از این دستورات برای مدیریت تانلها استفاده کنید:
# 🎛️ منوی مدیریت تعاملی (تمام عملیات در یک منو)
sudo bash dnstm-setup.sh --manage
# 📊 نمایش همه چیز: تانلها، اطلاعات احراز هویت، لینکهای اشتراکگذاری
sudo bash dnstm-setup.sh --status
# 🚇 افزودن یک تانل (تعاملی — انتخاب پروتکل، بکاند، دامنه)
sudo bash dnstm-setup.sh --add-tunnel
# ❌ حذف یک تانل خاص (تعاملی یا مستقیم)
sudo bash dnstm-setup.sh --remove-tunnel
sudo bash dnstm-setup.sh --remove-tunnel slip1
# 📋 نمایش تمام تانلها و وضعیت آنها
dnstm tunnel list
# 🔗 ایجاد لینک اشتراکگذاری (dnst:// برای dnstc)
dnstm tunnel share -t slip1
dnstm tunnel share -t dnstt-ssh --user tunnel --password secret
# لینکهای slipnet:// برای اپ SlipNet خودکار در خلاصه نصب نمایش داده میشوند
# — لینک رو تو گوشی اندروید باز کنید تا پروفایل وارد SlipNet بشه
# 📊 بررسی وضعیت روتر
dnstm router status
# 📜 مشاهده لاگهای روتر
dnstm router logs
# 🔍 مشاهده لاگ تانل خاص
dnstm tunnel logs --tag slip1
dnstm tunnel logs --tag dnstt1
dnstm tunnel logs --tag slip-ssh
# ⏹️ توقف / ▶️ شروع یک تانل
dnstm tunnel stop --tag slip1
dnstm tunnel start --tag slip1
# 🔀 توقف / شروع روتر DNS
dnstm router stop
dnstm router start
# 🧪 تست پروکسی SOCKS (بررسی پورت: ss -tlnp | grep microsocks)
# بدون احراز هویت:
curl --socks5 127.0.0.1:<MICROSOCKS_PORT> https://api.ipify.org
# با احراز هویت SOCKS5:
curl --socks5-basic --proxy socks5://127.0.0.1:<MICROSOCKS_PORT> --proxy-user user:pass https://api.ipify.orgsudo bash dnstm-setup.sh --usersاین دستور یک منوی تعاملی باز میکند:
| گزینه | عملکرد |
|---|---|
| 1 | لیست کاربران — نمایش تمام کاربران تانل SSH |
| 2 | افزودن کاربر — ساخت کاربر جدید (با رمز دستی یا خودکار) |
| 3 | تغییر رمز — بروزرسانی رمز عبور یک کاربر |
| 4 | حذف کاربر — حذف کاربر (با تأیید) |
| 0 | خروج |
کاربران تانل SSH چی هستن؟ کاربران محدود سیستمی هستن که فقط میتونن تانل SSH بزنن (پروکسی SOCKS، فوروارد پورت) — دسترسی shell ندارن و نمیتونن روی سرور شما دستوری اجرا کنن. برای تانلهای SSH (سابدامینهای
s2وds2) لازمن.
اگر sshtun-user نصب نباشد، اسکریپت خودکار آن را دانلود و تنظیم میکند.
ss -ulnp | grep -E ':53\b'
systemctl stop systemd-resolved.socket systemd-resolved.service
systemctl mask systemd-resolved.socket systemd-resolved.service
pkill -9 systemd-resolve
chattr -i /etc/resolv.conf 2>/dev/null; rm -f /etc/resolv.conf
echo "nameserver 8.8.8.8" > /etc/resolv.conf
chattr +i /etc/resolv.confdnstm tunnel list
dnstm tunnel logs --tag slip1
dnstm router logs- DNS resolverهای مختلف را امتحان کنید
- مطمئن شوید Transport صحیح انتخاب شده (Slipstream برای t2/s2، DNSTT برای d2)
- برای DNSTT، کلید عمومی را بررسی کنید
- پورت 53 (UDP و TCP) باید در فایروال هاستینگ باز باشد
sudo bash dnstm-setup.sh --uninstallاین دستور تمام اجزا (تانلها، روتر، dnstm، microsocks، sshtun-user) را حذف میکند.
حذف نمیشود (دستی انجام دهید):
⚠️ رکوردهای DNS در Cloudflare — از داشبورد حذف کنید⚠️ systemd-resolved — برای فعالسازی مجدد:
chattr -i /etc/resolv.conf 2>/dev/null
rm /etc/resolv.conf && ln -s ../run/systemd/resolve/stub-resolv.conf /etc/resolv.conf
systemctl unmask systemd-resolved.socket systemd-resolved.service
systemctl enable systemd-resolved && systemctl start systemd-resolvedاگر ترجیح میدهید مراحل را به صورت دستی (بدون این اسکریپت) انجام دهید:
📝 راهنمای کامل راهاندازی تانل DNS
اگر این پروژه به شما یا کسی که میشناسید کمک کرده تا به اینترنت آزاد دسترسی داشته باشد، میتوانید از ادامه توسعه حمایت کنید:
ساخته شده توسط SamNet Technologies — سامان