A generator prints a long list of candidate domain names; most are never used, and only one leads to a working server.

Domain Generation Algorithm (DGA)

A domain generation algorithm (DGA) is a procedure that generates candidate domain names. Malware can carry one so that infected devices and their operator each work out the same list of possible addresses for command and control, the channel that carries instructions. Generating a name does not register it: the operator often registers and sets up only some.

Malware that takes orders from a command and control server has to find it, and a fixed address can be blocked or seized. A DGA is one way to avoid depending on a single fixed name.

CyberRecaps is supported by its readers. We may earn an affiliate commission at no extra cost to you if you buy through a link on this page.

Ghost in the Wires by Kevin Mitnick
Two friends use the same rule to pick a meeting place; most of the names lead to closed doors, and only one cafe is really open.

Explain It Like I'm 10

Two friends agree on a rule for choosing where to meet: take today's date and turn it into a made-up cafe name. Each morning both of them work out the same name without talking. Most of those made-up names do not belong to any real cafe. A name only becomes a meeting place once one friend opens a cafe under it, and the other friend finds it by trying names from the list until a door opens. Someone who wants to stop the meetings has several options: learn the rule and watch the likely names, ask the city to close the cafe that really exists, or notice the person who keeps knocking on doors that are not there. Each option covers something different.

Domain Generation Algorithm Quiz

Test your knowledge about Domain Generation Algorithm - maybe you already know everything about it.

EasyQuestion 1 of 3

What does a domain generation algorithm generate?

Three separate steps: generating a name, registering it, and setting up its DNS records so a lookup reaches a server.

How does a domain generation algorithm work?

A DGA is a recipe for names. With the same inputs, the same algorithm produces the same names, so two parties that never exchange a message can work out the same list. The inputs can be a date, a constant or other values, and they are not necessarily secret. A 2016 measurement study of 43 malware families by researchers at Fraunhofer FKIE and partners found that for the majority of known DGAs, the inputs were known well enough to calculate every name the generator can produce.

MITRE ATT&CK, a public catalogue of attacker techniques, describes malware using a DGA to find a destination for command and control instead of relying on a fixed list of addresses. Some malware uses one as a fallback when contact with its main server is lost.

Generating, registering and configuring are separate steps

Three separate things have to happen before a generated name is useful to an operator:

  • Generating the name: any copy of the algorithm can do it.
  • Registering the name: someone obtains it from a registrar, and that has a price.
  • Configuring its DNS records: the Domain Name System, the internet's lookup service, needs name servers (the computers that answer lookups for a domain) and records so that a lookup returns an address.

Registration alone does not do that. ICANN, the nonprofit that coordinates the internet's domain-name system, documents registered domains that do not resolve: a domain with no name servers associated is "inactive", and a registry or registrar can place a domain on hold. Even a name that resolves needs a reachable service behind it before it works for command and control.

In the Pyramid of Pain, a model that ranks indicators by how hard they are for attackers to replace, domain names sit one step above IP addresses because they must be registered, paid for and hosted somewhere. Its creator, David Bianco, adds that many providers have lax registration standards, so changing domains is in practice not too hard. Generating strings is cheap. Registering names and running something behind them takes money and effort.

Why many candidates go unused

The list is longer than the operator needs. In the same 2016 study, 115,387 of the 18.4 million generated names that could be checked (0.63 percent) appeared in registration (WHOIS) records. Those records can belong to the operator, to a sinkhole operator or to an unrelated owner. Family by family, the share ranged from 0.01 percent to 57 percent.

Malware does not necessarily try every candidate either. Conficker C could generate 50,000 names a day, and each infected machine tried only 500 of them, according to the report of the Conficker Working Group, the coalition that fought the worm.

A randomness check flags jumbled-looking names, while names built from joined words pass it more easily.

What can a generated name look like?

The 2016 study sorted generators into four schemes by how they build a name. The table adds what each scheme means for someone judging names alone.

Scheme

What the names look like

What it means for detection

Arithmetic

Letter strings computed from a sequence of values; the most common scheme in the study

Names often look random, which is what simple checks of the letters themselves, such as entropy (a measure of randomness), aim to flag

Hash

Strings built from the hexadecimal form of a hash; MD5 and SHA256 were seen

Also random-looking, so the same letter-based checks apply

Wordlist

Words joined from one or more word lists, which the authors describe as less random-looking and so more camouflaged

Names look closer to ordinary ones, so simple letter-based checks can lose effectiveness

Permutation

Variations of one starting name

Names resemble each other and the starting name, so one name may not stand out alone

Defenders have several levers: predicting and blocking names, redirecting lookups to a sinkhole, working with registries, and cleaning infected devices.

What can defenders do about generated names?

Pleiades, an influential 2012 study by researchers at Damballa, the University of Georgia and Georgia Tech, describes blocklists as static because they are updated only after domains are discovered, often by a manual process. That limits reactive lists, not every blocklist. If the algorithm and its inputs are known, upcoming names can be computed and blocked before they are used. The authors also note that reverse engineering the malware to learn the algorithm is not always feasible, because malware can be updated quickly and obfuscated (deliberately made hard to read). So they built a system that detects generated names without reverse engineering the malware. In fifteen months in one internet provider's network, it identified twelve DGAs, six of them not previously reported.

Defenders therefore have several levers against a botnet, the network of infected devices that one operator controls, and they protect different things.

Approach

What it does

What it protects

Main limit

Predictive blocking

Computes upcoming names from a known algorithm and inputs, then blocks or reports them before use

One network, or many if shared

Needs the algorithm and inputs; MITRE calls reverse engineering time and resource intensive, and inputs unique to each sample add work

Behavioral detection

Looks for the pattern of generated lookups, such as similar failed lookups from several devices, without rebuilding the algorithm

The monitored network

Cannot recover the exact algorithm, so errors in both directions are expected

Local DNS filtering or sinkholing

The organization's own DNS server blocks chosen names or redirects them to a server it controls (a sinkhole)

That organization

Needs the names to act on, but not the purchase of every candidate

Registry-level disruption

Registries block names or hand control of them to defenders

A botnet's reach across networks

Needs coordination among registries and others

Endpoint remediation

Finds and removes the malware from infected devices

The device

Blocking names does not remove malware

Scope matters. Local filtering protects the organization that runs it. Disrupting a botnet globally usually involves registries, the organizations that run top-level domains such as .com, as the three operations below did. Registering every candidate is the costly path: MITRE calls it impractical because of the cost, and says a local DNS sinkhole can in some cases help at a reduced cost. ATT&CK's mitigation entries are examples of defenses, not a complete count of them.

An analyst weighs a burst of lookups for names that do not exist against ordinary software that also fails lookups.

Which signs point to a DGA, and when do they mislead?

NXDOMAIN is the DNS reply that means the name asked about does not exist, as the DNS standard defines it. A machine working through mostly unregistered candidates can produce a burst of them. NXDOMAIN is specific, though. A lookup can fail in other ways, such as a server error or a refusal, and a registered name can fail to resolve for the reasons above. Some traditional DGAs produce an NXDOMAIN-heavy pattern, and an operator that registers and sets up many of its names in advance can reduce it, though not necessarily remove it.

Three common signs each need context:

  • Random-looking names: a generated name can look ordinary, and legitimate services can also use machine-made names.
  • Bursts of NXDOMAIN responses: typos and misconfigured software also cause failed lookups, and the Pleiades system was designed to filter those out by looking for similar failures from several machines.
  • Lookups from a program that is not a browser: legitimate non-browser software makes lookups too.

What name-based detection can and cannot do

In 2010, Yadav and colleagues at Texas A&M University and Narus proposed spotting generated names from character statistics across groups of domains, without the algorithm. They used it to find Conficker and a previously unknown botnet in an internet provider's traffic, and their paper already describes a generator that builds English-like words.

A 2026 preprint on arXiv from Dakota State University tested two string-analysis checks, including Shannon entropy, and two machine-learning detectors on one threat actor's text-message phishing domains from 2022 to 2025. In that dataset the tools did best on random-looking strings and worse on joined dictionary words and themed word combinations, often with low recall. That describes one campaign and the tool versions tested, not detectors in general.

Investigating an alert

DNS server logs show which device asked, not which program. Linking queries to a process takes endpoint telemetry (records kept on the device itself) or correlation with other logs, which is why MITRE's detection ideas pair DNS records with process logs. Correlating query behavior, timing, responses, endpoint activity and the connections the device makes afterwards gives a fuller picture than any one of them.

Start with the affected device and the process that sent the queries. Then read the evidence together: what the names look like, when the queries happened, what answers came back, what else the process did and whether the device later connected to anything unusual. If the evidence confirms a compromise, respond to it as to any malware infection. Blocking a name does not remove the malware from the device.

Three operations: blocking a worm's names, sinkholing a criminal platform's domains, and reporting predicted names to registries; in each, infected devices still needed cleaning.

What did three large operations achieve?

Three documented operations show what disrupting DGA-based botnets achieved and what it did not. Each had different actors and a different method.

Conficker, 2008-2009

Variant A generated 250 names a day across five top-level domains. Researchers reverse engineered the worm's code to reproduce its name generator. A working group of Microsoft, ICANN, registry operators, antivirus vendors and researchers then worked to register or otherwise block the names before the worm's author could use them. When variant C generated 50,000 names a day from 1 April 2009, the names spanned more than 100 top-level domains, many of them country-code ones, so the group needed ICANN and the country-code registry operators. ICANN waived fees, though some registry operators say they still bore high costs.

The group's report, written for the US Department of Homeland Security by the Rendon Group, calls keeping the author from taking control of the botnet its biggest success and failing to clean up infected computers its biggest failure. Millions of A/B infections remained, and variant C could also update over peer-to-peer connections that do not use domains.

Avalanche, 2016

The Shadowserver Foundation, which supported law enforcement for 18 months, reported more than 20 malware families using multiple DGAs. It gives one figure for domains blocked or delegated to its sinkholes: over 800,000, in more than 60 top-level domains. A sinkhole is a server run by defenders that takes the criminals' place, so infected machines contact it instead. Shadowserver notes the sinkholed victims were still infected, and it describes the platform as double fast flux, so address rotation and generated names appeared in the same operation.

Necurs, 2020

Microsoft and partners in 35 countries moved against a botnet Microsoft said had infected more than nine million computers. Microsoft says it analyzed how Necurs generated names, predicted more than six million that would be created over the next 25 months, and reported them to the registries concerned so they could be blocked. The account describes reporting, not buying. A court order also let Microsoft take control of US-based infrastructure, and Microsoft worked with internet providers on cleanup. It says the botnet was significantly disrupted, not that it ended.

In a registered DGA, an operator uses an algorithm to register many domain names at once; the size of the pile alone shows scale, not malicious use.

What is a registered DGA?

Infoblox says it first described registered DGAs (RDGAs) in October 2023; its article cited here was published on 17 July 2024. In an RDGA, an operator uses an algorithm to register many domain names at one time. The algorithm sits on the infrastructure operator's side, not inside malware, and automated generation is not malicious in itself: Infoblox says criminals and legitimate businesses both use it, and some registrars offer tools that generate variants of a chosen name.

One example is Revolver Rabbit, which Infoblox counted as having registered over 500,000 domains in the .bond top-level domain. Infoblox later identified it as an advertising network that drops domains it no longer needs, and says neither it nor the network can confirm whether domains seen in malware samples were later used by bad actors. The count shows scale, not malicious use.

Four DNS techniques side by side: generating candidate names, rotating addresses behind one name, calculating an address from a reply, and hiding data inside lookups.

How does a DGA differ from fast flux, DNS calculation and DNS tunneling?

ATT&CK lists two neighbours under the same parent technique, Dynamic Resolution. DNS tunneling, a separate technique, also involves DNS:

ATT&CK files the technique as T1568.002, Dynamic Resolution: Domain Generation Algorithms, under the Command and Control tactic (version 1.2, last modified 12 May 2026). Its procedure examples cover more than twenty malware families and groups.

Layers that cover different things: disruption across many networks, detection on one network, and cleanup on the infected device.

How the layers fit together

No single lever covers every case. Detection can spot generated-name behavior on one network without knowing the algorithm. Prediction and registry action can cut off names for many networks but need the algorithm and cooperation. Neither removes malware from an infected device, which needs its own cleanup.