DNS Configuration
Basic DNS Records
You’ll need to create A (or AAAA for IPv6) records pointing to your VPS IP address.1
Create wildcard record
Create a wildcard subdomain record for your domain:
This allows any subdomain (e.g.,
app.example.com
, api.example.com
) to resolve to your VPS.2
Create root domain record (optional)
If you plan to use your root domain as a resource:
This is only needed if you want to use
example.com
(not just subdomains) as a resource.3
Wait for propagation
DNS changes can take 5 minutes to 48 hours to propagate globally.
Use Google DNS (8.8.8.8) or your provider’s DNS to test changes faster.
Port Configuration
Required Ports
Pangolin requires these ports to be open on your VPS:TCP Port 80
HTTP/SSL Verification
- Let’s Encrypt domain validation
- Non-SSL resources
- Can be disabled with wildcard certs
TCP Port 443
HTTPS Traffic
- Pangolin web dashboard
- SSL-secured resources
- Essential for operation
UDP Port 51820
Site TunnelsThis is the default port for sites (Newt) to establish tunnels to the proxy (Gerbil).
UDP Port 21820
Client TunnelsThis is the default port for clients relaying through Gerbil to newt. This port is only required for clients.
Always verify your exposed ports (e.g., with nmap or RustScan) and ensure you expose only the ports that are absolutely necessary. By tunneling out to the VPS, you are effectively including the VPS in your security boundary, so you must secure it as part of your overall network strategy. For more details, see Docker’s port publishing documentation.
Docker Port Exposure
By default, Pangolin exposes these ports on all interfaces:Firewall Configuration
Ensure your VPS firewall allows these ports:Configure security groups/firewall rules in your cloud provider’s dashboard to allow:
- TCP ports 80 and 443
- UDP ports 51820 and 21820
Internal Network Configuration
Default Subnet Settings
Pangolin uses these default network settings:- Gerbil network: Uses first /24 subnet in
100.89.137.0/20
range - Site allocation: Each site gets a /30 subnet (4 IPs)
- CGNAT range: Avoids conflicts with most private networks
The
100.89.137.0/20
range is in the CGNAT (Carrier-Grade NAT) space, which should avoid conflicts with typical private networks (192.168.x.x, 10.x.x.x, 172.16-31.x.x).Important: If this subnet conflicts with your network, change it in your config before registering your first Gerbil.
Customizing Network Settings
If you need to change the default network:For heavy WireGuard usage, consider increasing
site_block_size
to 29 (8 IPs) or 28 (16 IPs) per site.Docker Networking
Local Services
When deploying services in Docker alongside Pangolin:Container Communication
Container Communication
For services in the same Docker Compose:
- Use service names as hostnames
- Example:
http://pangolin:8080
- Docker Compose creates internal network automatically
Host Machine Access
Host Machine Access
To access services on the host machine:
- Use
172.17.0.1
(Docker bridge gateway) - Or use
host.docker.internal
(Docker Desktop) - Example:
http://172.17.0.1:3000
External Services
External Services
For services outside Docker:
- Use the host’s public IP address
- Ensure firewall allows the required ports
- Consider using VPN or secure tunnels