MasterDnsVPN is a powerful, cross-platform DNS tunneling VPN written in Python. It enables secure and covert data transmission by encapsulating VPN traffic within DNS queries and responses, allowing users to bypass network restrictions and firewalls by leveraging DNS as a transport channel.
MasterDnsVPN provides both server and client components, featuring robust encryption, flexible domain management, resolver balancing, and automatic MTU optimization. It is designed for bypassing censorship, enabling secure communication in restricted networks, and supporting research or educational purposes. For alternative DNS tunneling solutions, consider Dnstt, SlipStream, Iodine, or DNSCat2.
┌────────────┐ DNS Queries ┌────────────┐ ┌────────────┐
│ Client │ <----------------> │ Server │ <--> │ Internet │
│ (Python) │ (Encapsulated) │ (Python) │ │ (DNS) │
└────────────┘ └────────────┘ └────────────┘
- 🗝️ Client encodes and encrypts VPN data into DNS queries.
- 🔓 Server decodes, decrypts, and forwards data to the internet.
- 🔁 Replies are sent back via DNS responses.
- 🛡️ DNS tunneling for VPN traffic (bypass firewalls and censorship)
- 🐍 Simple, readable Python codebase
- ⚙️ Configurable server and client with easy Python config files
- 🔒 Multiple encryption methods: XOR, ChaCha20, AES-CTR (128/192/256) + SSL
- 🌐 Support for multiple tunnel domains and DNS resolvers
- 📏 MTU testing and optimization for upload/download
- 🎲 Resolver balancing strategies: random, round robin, least packet loss
- 🚫 Automatic exclusion of slow or lossy resolvers
- 📋 Logging with selectable verbosity
- 💻 Cross-platform (Windows, Linux, macOS; Python 3.6+)
- 🐍 Python 3.6 or higher
- Clone the repository:
git clone https://github.com/masterking32/MasterDnsVPN.git cd MasterDnsVPN - Install dependencies:
pip install -r requirements.txt
- Copy and edit the config:
cp server_config.py.simple server_config.py # Edit server_config.py as needed - Run the server:
python server.py
- Copy and edit the config:
cp client_config.py.simple client_config.py # Edit client_config.py as needed - Run the client:
python client.py
- 🌍 Domains: Use your own domain(s) pointed to the server's IP for tunneling.
- 🔑 Encryption: Set the same encryption method and key on both client and server. The key is generated by the server on first run (see logs).
- ⚡ Resolvers: Use fast, reliable DNS resolvers for best performance.
- 📏 MTU: The client will test and recommend optimal MTU values for upload/download.
- 🚫 Packet Loss: Remove or comment out slow/losing resolvers in the client config.
Contributions are welcome! Please fork the repository and create a pull request with your changes.
This project is licensed under the MIT License. See the LICENSE file for details.
Developed by MasterkinG32