Skip to main content
T1568.002Command and Controlmedium difficulty

Domain Generation Algorithms

A domain generation algorithm lets malware compute a fresh list of candidate command-and-control domains, often on a schedule, instead of hardcoding a single address. The operator only needs to register a few of them, so blocking one domain never cuts the channel. For an analyst the visible trace is the failed lookups: many NXDOMAIN answers from one host.

Practice the detection skills around Domain Generation Algorithms on realistic SIEM, Firewall alerts in SOCSimulator Operations.

SIEMFirewall

What is Domain Generation Algorithms?

“Domain Generation Algorithms is documented as technique T1568.002 in MITRE ATT&CK® v19.1 under the Command and Control tactic. Detection requires visibility into SIEM, Firewall telemetry.”

The malware carries the algorithm. At startup, and again whenever contact is lost, it uses a seed to produce a list of names, then walks the list asking DNS for each. The operator runs the same algorithm, registers a few of the names ahead of time and puts the C2 server behind them. Most lookups fail and one succeeds, and the malware has its server. MITRE gives two shapes. Letter-based names look like gibberish (istgmxdejdnxuyla.ru), while word-based names glue dictionary words together (cityjulydish.net).

The seed decides whether defenders can get ahead of it. Many DGAs are time-based and produce a new list every hour, day or month. MITRE records Conficker seeding from the victim's UTC date, Bazar using the current date, ShadowPad keying on the day of the month, Grandoreiro using a per-user key that changes daily, and APT41 changing C2 servers monthly. Infoblox describes Bumblebee adding a DGA that iterates through a list of 100 generated domains until one answers, which shows that only some of them were registered. Unit 42 notes DGAs have been in constant use since at least 2008.

Some families use the algorithm for resilience instead of as the first choice. CCBkdr and CHOPSTICK use it as a fallback channel when the primary C2 is lost, so the lookups may start only after the main server goes dark.

Where Domain Generation Algorithms fits in an attack

T1568.002 is one of three Dynamic Resolution sub-techniques, next to Fast Flux DNS (T1568.001) and DNS Calculation (T1568.003), and it sits in Command and Control. It is a symptom of an infection that has already run. Unit 42 puts it plainly: a DGA cannot harm you by itself, it makes the malware harder to block. In your logs it shows up right after execution, at each reboot and whenever the main C2 stops answering.

MITRE's procedure list reads like a catalog of commodity malware and espionage tooling: QakBot, Ursnif, Bazar, AsyncRAT, Astaroth, ShadowPad, Conficker and APT41. A DGA hit therefore says little about who is behind it. Recovering the algorithm means reverse engineering the sample, which MITRE calls time and resource intensive, and malware that mixes in a per-instance seed makes the future domains unpredictable even then.

The variant to know is the registered DGA. Infoblox describes actors that generate domains, register all of them, and either use them at once or age them for months. Because the names resolve, the NXDOMAIN burst that traditional DGAs produce mostly disappears, and the algorithm stays private to the actor instead of sitting in a sample you can reverse. Infoblox reports some actors maintaining more than 80,000 domains at a time and says traditional DGAs are less common than they were five to seven years ago.

Detection Strategies

The following detection strategies help SOC analysts identify Domain Generation Algorithms activity. These methods apply across SIEM, Firewall environments and can be implemented as detection rules, correlation queries, or behavioral analytics in your security platform.

SPL
source="XmlWinEventLog:Microsoft-Windows-Sysmon/Operational" EventCode=22 QueryStatus=9003
| where NOT match(Image, "(?i)(chrome|msedge|firefox)\.exe$")
| bin _time span=5m
| stats count AS nxdomain dc(QueryName) AS distinct_names values(QueryName) AS names BY host Image _time
| where nxdomain >= 20 AND distinct_names >= 15
| eval sample=mvindex(names, 0, 4)
| table _time host Image nxdomain distinct_names sample

Finds processes that collect at least 20 NXDOMAIN answers for 15 or more different names within five minutes. QueryStatus 9003 is the Windows code for a name that does not exist. Browsers are excluded because they generate random single-label probes of their own, so remove that line if you want to see them too. The thresholds are starting points for a typical workstation.

SPL
source="XmlWinEventLog:Microsoft-Windows-Sysmon/Operational" EventCode=22 QueryStatus=9003
| rex field=QueryName "(?<label>[^.]+)\.[a-zA-Z0-9-]+\.?$"
| eval label_len=len(label)
| where label_len >= 12
| lookup ut_shannon_lookup word AS label
| where ut_shannon >= 3.1
| stats dc(label) AS distinct_labels avg(ut_shannon) AS avg_entropy values(label) AS labels BY host Image
| where distinct_labels >= 10

Adds name scoring on top of the failure signal: it keeps failed lookups whose second-level label is at least 12 characters with at least 3.1 bits of entropy, then counts distinct labels per process. It needs the URL Toolbox app for the entropy lookup. Entropy only works as one feature among several, so treat the output as a lead and not as a verdict.

Simulated example generated by SOCSimulator Research
// Sysmon Event ID 22, first lines of the burst on WS-0731 (QueryStatus 9003 = NXDOMAIN)
UtcTime: 2026-10-04 10:15:02.118  Image: C:\Users\Public\Libraries\svcupd.exe  QueryName: pxyqqbfwzspzmnd.ru     QueryStatus: 9003
UtcTime: 2026-10-04 10:15:02.436  Image: C:\Users\Public\Libraries\svcupd.exe  QueryName: pkpggaasxbtu.xyz       QueryStatus: 9003
UtcTime: 2026-10-04 10:15:02.771  Image: C:\Users\Public\Libraries\svcupd.exe  QueryName: onyosxkbbajghf.top     QueryStatus: 9003
UtcTime: 2026-10-04 10:15:03.093  Image: C:\Users\Public\Libraries\svcupd.exe  QueryName: gpnpgiphhwbcfk.info    QueryStatus: 9003
UtcTime: 2026-10-04 10:15:03.402  Image: C:\Users\Public\Libraries\svcupd.exe  QueryName: itoijfuncvkj.ru        QueryStatus: 9003
... 19 more NXDOMAIN lookups from the same image in this five-minute bucket ...
UtcTime: 2026-10-04 10:15:41.902  Image: C:\Users\Public\Libraries\svcupd.exe  QueryName: qmdtvlkzehuxn.info     QueryStatus: 0  QueryResults: 203.0.113.77;

// First query result
_time                host     Image                                     nxdomain  distinct_names  sample
2026-10-04 10:15:00  WS-0731  C:\Users\Public\Libraries\svcupd.exe     24        24              pxyqqbfwzspzmnd.ru, pkpggaasxbtu.xyz, onyosxkbbajghf.top, gpnpgiphhwbcfk.info, itoijfuncvkj.ru

// Second query result
host     Image                                     distinct_labels  avg_entropy
WS-0731  C:\Users\Public\Libraries\svcupd.exe     22               3.36

// For comparison, the same formula gives: cityjulydish 3.25, windowsupdate 3.39

Tuning and false positives

Several ordinary things look like this. Content delivery networks, update services and cloud storage endpoints use machine-generated hostnames that score high on entropy. Chromium-based browsers send random single-label lookups on their own, and the answers normally come back NXDOMAIN. An application pointed at a retired hostname retries it all day, and a vulnerability scanner or an internal red team running DNS brute force makes thousands of failed lookups by definition.

The discriminator is distinct names per process. A retry loop produces many failures for one name, a scanner usually runs from a host you can name, and browsers are a known image you can exclude. A DGA produces many different names from an executable that has no business resolving them, most of them failing. Combine the failure burst with name scoring and process context, and review the first week of alerts to build the allowlist before you rely on the rule.

Example Alerts

These realistic alert examples show what Domain Generation Algorithms looks like in your security tools. Use them to tune detection rules and train analysts to recognize true positives versus false positives in live environments.

HighSIEM

NXDOMAIN Burst From a Non-Browser Process

svcupd.exe, running from C:\Users\Public\Libraries on WS-0731, made 24 DNS lookups for 24 different names in five minutes and every one returned NXDOMAIN. A 25th name resolved and the host connected to 203.0.113.77 seconds later.

MediumSIEM

High-Entropy Second-Level Labels From One Image

22 distinct 12 to 16 character labels with an average entropy of 3.36 bits were queried by the same executable, none of them seen in the last 30 days of resolver logs.

LowFirewall

Host Sending DNS Directly to Public Resolvers

WS-0731 sent 412 DNS flows to 6 external resolvers in an hour, bypassing the internal resolvers that normally answer for the subnet.

Responding to Domain Generation Algorithms

Start with the host and the process. Take the image path, the hash and the parent process from the DNS event, and check whether the binary is signed and where it lives. Then look at the lookups themselves. The one name that resolved is your live C2 candidate, so record its answer, its registration date from RDAP and its history in passive DNS, and look for connections from the same host to that address right after the lookup.

Block and scope. Add the resolved domain and address to the blocklist or sinkhole, but do not stop there: the algorithm will produce a new list tomorrow, so the lasting fix is removing the malware. Search resolver logs for other hosts querying the same names and the same pattern, because one infection often means a family that landed on several machines. If threat intelligence identifies the family and its algorithm, pre-block the upcoming domains, though MITRE notes this is expensive and a per-instance seed defeats it.

For registered DGAs, work from the infrastructure instead of the failures. Cluster the resolved names by registrar, creation date and name servers, and treat a group of recently registered, similar-looking domains seen from one host as one campaign. Finish by reimaging or cleaning the host according to what the process turned out to be, and rotate any credentials that were present on it.

Frequently Asked Questions

How do SOC analysts detect Domain Generation Algorithms?
Detection centers on SIEM, Firewall telemetry for the command and control phase of the attack. Score the names, but never on entropy alone. MITRE's analytics look for high-entropy, gibberish-looking labels and for DGAs that concatenate whole words, which score lower. Shannon entropy on short strings is capped by their length and overlaps with legitimate names: in the simulated sample on this page, 24 random labels scored between 2.9 and 3.6 bits, while the ordinary-looking windowsupdate scores 3.4 by the same formula. Add label length, the share of dictionary words and a lexical similarity check against the domains your network normally resolves. Watch the resolver for failure, not only for odd names. A host that fires a burst of lookups for many different names, almost all NXDOMAIN, and then connects once one resolves is the DGA rhythm. MITRE's Windows and Linux analytics (AN1178, AN1179) key on abnormal query rates, failed lookups and high NXDOMAIN rates. Count distinct names, not total failures, because an application retrying one dead hostname also produces a pile of NXDOMAIN answers.
What does a Domain Generation Algorithms alert look like?
A representative SIEM detection is "NXDOMAIN Burst From a Non-Browser Process" (high severity): svcupd.exe, running from C:\Users\Public\Libraries on WS-0731, made 24 DNS lookups for 24 different names in five minutes and every one returned NXDOMAIN. A 25th name resolved and the host connected to 203.0.113.77 seconds later.
Which tools detect Domain Generation Algorithms, and how can I practice?
Domain Generation Algorithms (T1568.002) is best surfaced with SIEM, Firewall telemetry, which exposes the command and control signals described above. There is no dedicated SOCSimulator room for it yet; practice the surrounding detection skills on those consoles in SOCSimulator Operations, free.

Build the Skills Behind Domain Generation Algorithms

We don't have a dedicated room for Domain Generation Algorithms yet. Practice the surrounding detection skills across SOCSimulator Operations, free.

Explore Operations
Tool

SIEM Training Console: SOCSimulator

The SIEM console in SOCSimulator replicates the workflow of enterprise platforms like Splunk Enterprise Security, Micros…

Read more
Tool

Firewall Training Console: SOCSimulator

The Firewall console in SOCSimulator replicates the log analysis experience of enterprise platforms like Palo Alto Netwo…

Read more
Glossary

What is Command and Control? SOC Glossary

Command and Control (C2) refers to the infrastructure and communication channels adversaries use to remotely direct malw…

Read more
Glossary

What is NDR? SOC Glossary

NDR (network detection and response) is security software that analyzes network traffic, as raw packets or flow metadata…

Read more
Glossary

What is Firewall? SOC Glossary

A firewall is a network security control that inspects traffic crossing a boundary and permits or denies it against a co…

Read more
Glossary

What is IOC (Indicator of Compromise)? SOC Glossary

In cyber security, an indicator of compromise (IOC) is forensic evidence, such as a file hash, IP, or domain, that links…

Read more
Career Path

SOC Analyst (Tier 2) Career Guide: Salary & Skills

Tier 2 SOC Analysts handle the investigations that Tier 1 escalates. You dig into multi-stage attacks, coordinate contai…

Read more
Career Path

Threat Hunter Career Guide: Salary & Skills

Threat Hunters do not wait for alerts. You develop hypotheses based on threat intelligence and adversary behavior models…

Read more
Comparison

SOCSimulator Vs. Letsdefend: Platform Comparison

SOCSimulator wins on operational realism. You get multi-tool shift simulation with SLA pressure, noise injection, and al…

Read more
Glossary

SOC Glossary: Security Operations Terminology

Complete glossary of Security Operations Center terminology for aspiring SOC analysts.

Read more
Feature

Shift Mode: Real-Time SOC Simulation

Practice alert triage under realistic time pressure with SLA timers and noise injection.

Read more
Feature

Operations: Guided Training Operations

Structured CTF-style investigation operations covering real-world attack scenarios.

Read more