DNS tunnels and DGA malware
Detect DNS tunnels and DGA malware per computer, alert the SIEM, and optionally block the domain of a tunnel.
Back to the DNS Firewall service
Malware hides in DNS because DNS is allowed everywhere.
A DNS tunnel smuggles data out in thousands of random names under one domain.
A DGA malware tries hundreds of random domains until it finds its command server.
The DNS Firewall spots both, computer by computer, and tells you which one is infected.
Benefits
- You learn which computer is infected, by its IP address, within five minutes.
- The analysis runs in memory, beside the DNS service.
It adds no delay to the answers. - Each alert goes to the console notifications, to syslog and to your SIEM.
- Alert only by default: nothing is blocked until you decide it.
- The optional block refuses the domain of a tunnel for a limited time, for every computer.
- A built-in list ignores the services that use random names on purpose, such as spam blacklists and antivirus reputation.
Use cases
- A security team wants to know when a laptop sends data out through DNS.
- A SOC receives the alerts in its SIEM and opens an incident for the computer named in the alert.
- A school detects an infected computer that keeps querying domains that do not exist.
- A company cuts an active DNS tunnel at once, while it cleans the computer.
How the detection works
The DNS Firewall analyses each computer over windows of five minutes.
- DNS tunnel: one computer queries at least 150 distinct names under the same domain.
The names are long, 20 characters on average, and look random.
A computer that sends at least 100 TXT, NULL or ANY queries to 50 distinct names of one domain also raises an alert. - DGA malware: one computer gets an NXDOMAIN answer for at least 40 distinct domains with random-looking names.
The domains of a tunnel are not counted here.
One alert is raised per type, computer and domain, at most once an hour.
The detection needs the DNS Firewall: it reads the queries the service receives.
See the alerts
- Open DNS in the left menu, then the DNS threats tab.
- The Alerts subtab lists the last 200 alerts, the most recent first.

| Column | Meaning |
|---|---|
| Date | When the alert was raised. |
| Type | TUNNEL or DGA. |
| Client | The IP address of the computer, with the number of names and their average randomness in bits per character. |
| Domain | The domain of the tunnel, and three examples of the names queried. |
| Status | Alert only, or the result of the block when the option is on. |
The same alerts are written in three places:
- the console notifications
- syslog, with the tag
dns-threat, so the remote syslog targets and the SIEM receive them /var/log/dns-threats.log, one JSON line per alert
A syslog line looks like this:
dns-threat: Possible DNS tunnel from 192.168.4.1 to exfil-tunnel-demo.net: 100 queries, 100 distinct subdomains in 5 minutes, average length 52.0, entropy 4.5 bits per character, 0 TXT/NULL queries.
Settings
The Parameters subtab shows the current state.
Click Edit the detection to change it.


| Setting | Meaning |
|---|---|
| Detect DNS tunnels and DGA malware | On by default. |
| Block the domain of a detected tunnel | Off by default. When on, the DNS Firewall answers REFUSED for that domain to every computer. |
| Block duration (minutes) | From 5 to 1440 minutes, 60 by default. A restart of the DNS service also lifts the block. |
| Domains never analysed | One domain per line, its subdomains included. Add the internal services that use random names, such as telemetry or backup. |
A DGA alert never blocks anything.
Blocking random domains would only cut the DNS of the infected computer, while the malware keeps trying new names.
Before turning on the block
The thresholds were set on test traffic.
Leave the detection in alert mode for a few days first.
When an alert names a legitimate service, add its domain to Domains never analysed.
Turn the block on once the alerts only show real threats.
To check a block from a shell of the appliance:
dnsdist -C /etc/dnsdist.conf -c -e 'showDynBlocks()'
A blocked domain appears with the reason Artica: DNS tunnel and the seconds left.
Artica Meta
The DNS Firewall policy carries Detect DNS tunnels and DGA malware, Block the domain of a detected tunnel and Block duration.
The list of domains never analysed stays local to each node.
It can be changed on a node even when Meta holds the other settings.
Reference
- Settings:
DNSThreatDetectDisable(0 means on),DNSThreatBlock,DNSThreatBlockMinutes,DNSThreatWhitelist - REST API of the appliance:
GET /dnstap/threatsandPOST /dnstap/threats - Alert log:
/var/log/dns-threats.log - The Artica AI assistant reads and changes these settings with the skills
dnsfw.threats.statusanddnsfw.threats.set, after confirmation