Earlier domain-based attack methods had limitations i.e., attackers depended on a limited set of domains or IPs, making it easier for defenders to recognize patterns and disrupt C2 communication. Modern malware, however, employs more sophisticated techniques such as encrypted channels and DGAs, which bypass traditional blacklisting and necessitate advanced detection methods.
Among these, DGAs have become a powerful technique used by adversaries, as classified under MITRE ATT&CK – T1568.002. – (Dynamic Resolution: Domain Generation Algorithms, Sub-technique T1568.002 – Enterprise | MITRE ATT&CK®, no date).
At its core, a DGA is a deterministic algorithm that generates domain names based on specific input values. – (What is a DGA?, no date). Here’s how it works:
By frequently rotating domains, DGAs provide a resilient mechanism for malware communication, challenging defenders to develop more sophisticated countermeasures for effective mitigation.
Here is a typical workflow of a C2 server communication through a malware. Later, we will apply DGA into this workflow so we can understand it better.

When the attacker creates their DGA, they have a copy of it for themselves in which they would get their generated domains. – (CEH, 2024; What is a DGA?, no date).
The attacker from his/her end, registers only one to a few of the generated domains that he/she selects, at the domain registrar (like GoDaddy) to make them seem official. This would make it harder for defenders to predict which ones will be active and it’s also cheaper to register a few domains than to register all of them. The selection usually depends on the cost of the TLDs and the availability to see if the domain is already registered by someone else.
If the domain is available, the attacker registers it by providing fake information to stay anonymous, and they would proceed with their payment with either cryptocurrencies or stolen credit cards to avoid linking the transaction back to themselves. They would do the same for other selected inactive domains.
After registration, the domains that were registered become active and the attacker has two options now:
Now the attacker has done their part, they would then create their malware which would be executed on the target system. This malware would use the same DGA and generate the same domain list.
The malware would try and resolve all of these domains from its list to their IP addresses. There won’t be any resolving output connection for the non-registered domains because those domains are inactive (they have no IP addresses configured). But, when it queries the attacker-registered domain(s), it resolves the domains to the IP addresses that the attacker set up for that registered domain i.e., to their C2 server or C2 servers. The infected system would then communicate back to the attacker’s C2 server(s).
When the querying of the attackers registered domain happens, the malware contains a domain resolution module to do that querying. The malware would use a standard API e.g., gethostbyname() to perform DNS lookups for each domain. It cycles through the list of domains and attempts to resolve them one by one. Whatever domain was registered, the IP addresses would get resolved.
After resolving a domain to an IP address (to the C2 server), the malware uses the communication protocol module and tries to connect to the C2 server using network protocols like HTTP(s), TCP, or UDP.
The attacker can distribute this attack to a botnet of computers. This happens when multiple systems are infected with the malware, and all these systems would communicate with the C2 server(s) as a part of the botnet. This communication can take place in two ways:
Now, from the basic C&C attack technique view from fig (1), when we apply the involvement of DGA, we get:

To be direct, they can do lots of things:
The list can go on. Doing all this can enable lateral movement, credential harvesting, data encryption (ransomware infection), spying on the victim, persistence and evasion, weaponizing the bot for a DDoS attack, etc.
Security teams defend against DGA attack techniques through the following ways (Team, 2024):
Reverse Engineer the DGA: Analyze the malware to understand the algorithm and predict the domains.
Use DNS Filtering and Analysis: Look for domains with high entropy (randomness) or random patterns.
Behavioural Analysis: Identify unusual DNS activity from infected systems.
Collaborate with Registrars: Work with domain registrars to pre-emptively block or sinkhole predicted domains. Sinkholing works when the security teams are able to successfully predict the domain generating pattern from the malware and they may either register them or take control of them if they are already registered, usually by working with domain registrars. This makes the domains “active” but instead of resolving to the attacker’s C2 server, they are redirected to a controlled, safe server (the “sinkhole”).
This redirection process allows security teams to:
Security teams monitor domain registrations and traffic for patterns indicating DGAs (IoCs) like non-human readable domain names, or rapid domain lookups to flag them and add them to blocklists.
They are trained to distinguish between legitimate and DGA-generated domains based on features like length, character composition, etc.
Security tools analyze DNS query logs for unusual patterns like, high volumes of queries to non-existent (non-registered) domains or domains that don’t resolve. With this, they can track whichever infected system attempts to resolve DGA-generated domains.
Security tools integrate with threat intelligence platforms to keep updated lists of known DGA patterns, algorithms, or active malicious domains.
CEH, S.B.C., CCSP, CISM, OSCP (2024) ‘Protecting Against Cyber Threats: The use of Domain Generation Algorithm (DGA) by threat actors’, Medium, 2 March.
Available at: https://osintph.medium.com/protecting-against-cyber-threats-the-role-of-domain-generation-algorithm-dga-80c3ec3cda9f (Accessed: 2 January 2025).
Dynamic Resolution: Domain Generation Algorithms, Sub-technique T1568.002 – Enterprise | MITRE ATT&CK® (no date).
Available at: https://attack.mitre.org/techniques/T1568/002/ (Accessed: 2 January 2025).
Team, V. (2024) Demystifying Domain Generation Algorithms, Vercara.
Available at: https://vercara.com/resources/demystifying-domain-generation-algorithms (Accessed: 2 January 2025).
What is a DGA? (no date) Search Security.
Available at: https://www.techtarget.com/searchsecurity/definition/domain-generation-algorithm-DGA (Accessed: 2 January 2025).