dnstt-deploy

repository·main·Indexed 20 days ago

https://github.com/bugfloyd/dnstt-deploy

An automation tool for deploying and managing dnstt DNS tunnel servers on Linux. It simplifies the setup of DNS tunneling, management of systemd services, and configuration of SOCKS or SSH modes. The tool includes an interactive menu for reconfiguring the server, updating the script, and monitoring service logs and status.

Tokens
2.7K
Snippets
11
Records
21
Agent score
23%

What's inside dnstt-deploy

  1. Configure Tunnel Modes: SOCKS vs SSH

    main

    During the setup process, you can choose between two tunnel modes:

    SOCKS Mode (Option 1)

    • Sets up an integrated Dante SOCKS5 proxy.
    • Listens on 127.0.0.1:1080.
    • Forwards the SOCKS proxy to clients connected to the tunnel.

    SSH Mode (Option 2)

    • Automatically detects the SSH port (default: 22).
    • Ideal for secure shell access via DNS.
    • Compatible with mobile applications.
    • Forwards the server's SSH port to clients connected to the tunnel.
  2. How to support and switch between multiple domains

    main

    The script supports multiple domains by creating separate key pairs for each. However, only one domain configuration can be active at a time because all configurations share port 53 for DNS traffic.

    To switch domains:

    1. Run dnstt-deploy.
    2. Select Option 1 (Install/Reconfigure dnstt server).
    3. Enter the new subdomain when prompted.
  3. Install dnstt-deploy

    main

    You can install and start the interactive setup process with a single command. This will download the script to /usr/local/bin/dnstt-deploy and begin the automatic configuration of your dnstt server.

    Prerequisites:

    • Linux server (Fedora, Rocky, CentOS, Debian, or Ubuntu)
    • Root access or sudo privileges
    • Internet connection
    • Properly configured DNS records (see DNS Domain Setup)
    bash <(curl -Ls https://raw.githubusercontent.com/bugfloyd/dnstt-deploy/main/dnstt-deploy.sh)
  4. Connect using the dnstt-client

    main

    To use the tunnel, download the appropriate client binary from dnstt.network. Once you have your server's public key (found in /etc/dnstt/), use the following command structure to connect:

    dnstt-client -udp <DNS_SERVER_IP>:53 -pubkey-file <path_to_pubkey> <tunnel_subdomain> <local_address>:<local_port>

    Example Connection:

    dnstt-client -udp 127.0.0.53:53 -pubkey-file server.pub t.example.com 127.0.0.1:7000

    Finding your DNS_SERVER_IP:

    • Linux: systemd-resolve --status | grep "DNS Servers"
    • Windows: ipconfig /all | findstr /C:"DNS Servers"
    • macOS: scutil --dns | grep nameserver
    dnstt-client -udp DNS_SERVER_IP:53 -pubkey-file server.pub t.example.com 127.0.0.1:7000
  5. Configure DNS records for dnstt deployment

    main

    Before installing dnstt-deploy, you must configure your domain's DNS records to point to your server. This allows DNS traffic to be routed to your tunnel server.

    Required Setup Example:

    • Domain: example.com
    • Server IPv4: 203.0.113.2
    • Tunnel Subdomain: t.example.com
    • Server Hostname: tns.example.com

    DNS Records to Add:

    TypeNamePoints to
    Atns.example.com203.0.113.2
    AAAAtns.example.com2001:db8::2 (optional)
    NSt.example.comtns.example.com

    Note: DNS propagation can take up to 24 hours. Ensure records are active before proceeding with installation.

  6. Monitor performance and connections

    main

    You can monitor the service using the internal log viewer (Menu option 4) or via manual commands:

    • Monitor connection counts: Check ports 5300 and 1080.
    • Check service resources: Use systemctl status.
    • Follow logs in real-time: Use journalctl with the follow flag.
    sudo ss -tulnp | grep -E "(5300|1080)"
    sudo systemctl status dnstt-server
    sudo journalctl -u dnstt-server -f --no-pager
    sudo ss -tulnp | grep -E "(5300|1080)"
    sudo systemctl status dnstt-server
    sudo journalctl -u dnstt-server -f --no-pager
  7. Manage dnstt server via interactive menu

    main

    Once installed, run the dnstt-deploy command to access an interactive management menu. This is the primary way to manage the server without manual configuration files.

    Menu Options:

    1. Install/Reconfigure dnstt server: Set up or modify configuration (MTU, Tunnel Mode, Subdomain).
    2. Update dnstt-deploy script: Check for and install script updates.
    3. Check service status: View current service status.
    4. View service logs: Monitor real-time logs (use Ctrl+C to exit).
    5. Exit: Quit the menu.
    dnstt-deploy
  8. Manage dnstt-deploy via the interactive menu

    main

    After installation, run the dnstt-deploy command to access an interactive management menu. The menu provides the following options:

    1. Install/Reconfigure dnstt server: Set up or change the server configuration (including MTU and Tunnel Mode).
    2. Update dnstt-deploy script: Check for and install script updates.
    3. Check service status: View the current status of the running services.
    4. View service logs: Monitor real-time logs (use Ctrl+C to exit).
    5. Exit: Close the menu.
    dnstt-deploy
  9. Configure DNS records for dnstt-deploy

    main

    Before using the script, you must configure your domain's DNS records to point to your server. This allows the DNS tunnel to route traffic through your domain.

    Required Setup Example:

    • Domain: example.com
    • Server IPv4: 203.0.113.2
    • Server IPv6 (Optional): 2001:db8::2
    • Tunnel Subdomain: t.example.com
    • Nameserver (NS) Hostname: tns.example.com

    DNS Record Table:

    TypeNamePoints To
    Atns.example.com203.0.113.2
    AAAAtns.example.com2001:db8::2 (if IPv6 available)
    NSt.example.comtns.example.com

    Note: DNS propagation can take up to 24 hours before the tunnel can be tested.

  10. Troubleshoot dnstt-deploy using the management menu

    main

    The dnstt-deploy management menu provides quick access to built-in troubleshooting tools:

    1. Check Service Status (Menu option 3): Verifies if the services are running correctly.
    2. View Service Logs (Menu option 4): Provides real-time monitoring of service logs.
  11. Configure MTU settings

    main

    MTU (Maximum Transmission Unit) affects the stability and speed of your DNS tunnel. You can adjust this via the dnstt-deploy interactive menu (Option 1).

    Recommended MTU Values:

    • 1400: Stable and fast networks.
    • 1232: Standard (Default).
    • 1200: Unstable or slow networks.
    • 512: Restricted or highly unstable mobile networks.

    Troubleshooting MTU Errors: If you see FORMERR: requester payload size X is too small (minimum Y), run dnstt-deploy, select option 1, and enter the suggested MTU value.