Detecting dynamic DNS domains in Splunk

Name a security breach or sample of malware in the last five years and you will come across a fairly common denominator: the malware (or the method of data exfiltration) used a “Dynamic DNS” hostname to connect to the Internet [1][2][3][4][5]. But what is dynamic DNS (DDNS)? Why do malicious actors use it? And how do network defenders detect it in their network?

On a basic level, dynamic DNS allows for sub-domains to have IP addresses that can be quickly changed, often in real-time. Legitimate users take advantage of this service by using providers such as noip.com or duckdns.org to create easy to remember subdomains (such as the example “myhouse.no-ip[.]org”) and point that subdomain towards an IP address like their home router. This means the user can easily connect to their home network using a domain name instead of a hard to remember IP address. If the user’s home IP address changes, they can just update their dynamic DNS provider with the new information.

Sadly, the same reason that the service is so useful for legitimate users is why malicious actors abuse it. The actor can hardcode these subdomains (evil.duckdns[.]org) into their malware. That way if the server infrastructure that the malware communicates to is unavailable, the actor can quickly change the IP address of the subdomain (evil.duckdns[.]org) to something else. More advanced malware will even use a domain generation algorithm (DGA) to create random looking strings of characters as a subdomain (for example d0290d00xasdf.no-ip[.]org) that could be based on something like the day of the year. If the malware author has the key to the DGA (like the day of the year) they know exactly which domain the malware will be pointing to on which day. This obfuscation can make it very difficult for network defenders to “block” the malicious domain, since it might only be valid for a single day.

The use of dynamic DNS providers for malicious purposes is extremely wide spread. OpenDNS Security Labs reported that over 56% of subdomains on some DDNS providers were malicious [6]. Similarly, Cisco reported that dynamic DNS linked websites were 19% more likely to be malicious than other websites [7]. The question is not “does the threat exist?” but rather, how does a defender detect these domains or mitigate them?

One idea is to create a lookup table by using a great blog post by OpenDNS from 2015 that discusses the top 20 most malicious dynamic DNS providers. Another option is downloading all known dynamic DNS providers (provided by www.malware-domains.com [8]). This list is much more comprehensive than the “top 20”, but it may increase your false positives as it is a substantially larger list. This zip requires some modifications to turn into a lookup table, but you can find scripts on github to help you automate the process [9]. Once you have your list of dynamic DNS provider domains, create a lookup table and run it against your domains from your DNS logs or proxy requests using the Splunk App UTbox [10] (developed by my fantastically talented team mate Cédric Le Roux).

Below is an example of a query that goes against bro DNS logs. Figure 1 shows it’s output.

index=bro *
| `ut_parse(query)`
| lookup ddns dyndns_domains AS ut_domain
| search isBad=True
| stats count by ut_domain

Figure 1

Figure 1

But just seeing the dynamic DNS providers isn’t that useful to a network defender. In Figure 2, a query shows all the subdomains that are connected to each dynamic DNS domain.

index=bro *
| `ut_parse(query)`
| lookup ddns dyndns_domains AS ut_domain
| search isBad=True
| stats count by ut_domain
| stats VALUES(ut_subdomain) by ut_domain
| rename "VALUES"(ut_subdomain) AS subdomain

Figure 2

Figure 2

Once you have this information you could create dashboards, alerts, or correlation searches in Enterprise Security that trigger whenever a users machine contacts an unusual domain hosted on a dynamic DNS providers network. You could even write a search that looked for subdomains of dynamic DNS domains that had high entropy… but I’ll leave that for another blog post :-)

[1]
https://media.kasperskycontenthub.com/wp-content/uploads/sites/43/2018/03/08074802/KL_report_syrian_malware.pdf

[2]
http://threatgeek.typepad.com/files/fta-1009—njrat-uncovered-1.pdf

[3]
https://www.bluecoat.com/documents/download/2c832f0f-45d2-4145-bdb7-70fc78c22b0f

[4]
https://www.mpi-sws.org/~stevens/pubs/sec14.pdf

[5]
https://media.kasperskycontenthub.com/wp-content/uploads/sites/43/2018/03/08070901/darkhotelappendixindicators_kl.pdf

[6]
https://labs.opendns.com/2013/04/15/on-the-trail-of-malicious-dynamic-dns-domains/

[7]
http://blogs.cisco.com/security/dynamic-detection-of-malicious-ddns

[8]
http://www.malware-domains.com/files/dynamic_dns.zip

[9]
https://github.com/sooshie/bro-scripts/tree/master/dynamic_dns

[10]
https://splunkbase.splunk.com/app/2734/

Related Articles

Predicting Cyber Fraud Through Real-World Events: Insights from Domain Registration Trends
Security
12 Minute Read

Predicting Cyber Fraud Through Real-World Events: Insights from Domain Registration Trends

By analyzing new domain registrations around major real-world events, researchers show how fraud campaigns take shape early, helping defenders spot threats before scams surface.
When Your Fraud Detection Tool Doubles as a Wellness Check: The Unexpected Intersection of Security and HR
Security
4 Minute Read

When Your Fraud Detection Tool Doubles as a Wellness Check: The Unexpected Intersection of Security and HR

Behavioral analytics can spot fraud and burnout. With UEBA built into Splunk ES Premier, one data set helps security and HR reduce risk, retain talent, faster.
Splunk Security Content for Threat Detection & Response: November Recap
Security
1 Minute Read

Splunk Security Content for Threat Detection & Response: November Recap

Discover Splunk's November security content updates, featuring enhanced Castle RAT threat detection, UAC bypass analytics, and deeper insights for validating detections on research.splunk.com.
Security Staff Picks To Read This Month, Handpicked by Splunk Experts
Security
2 Minute Read

Security Staff Picks To Read This Month, Handpicked by Splunk Experts

Our Splunk security experts share their favorite reads of the month so you can follow the most interesting, news-worthy, and innovative stories coming from the wide world of cybersecurity.
Behind the Walls: Techniques and Tactics in Castle RAT Client Malware
Security
10 Minute Read

Behind the Walls: Techniques and Tactics in Castle RAT Client Malware

Uncover CastleRAT malware's techniques (TTPs) and learn how to build Splunk detections using MITRE ATT&CK. Protect your network from this advanced RAT.
AI for Humans: A Beginner’s Field Guide
Security
12 Minute Read

AI for Humans: A Beginner’s Field Guide

Unlock AI with the our beginner's field guide. Demystify LLMs, Generative AI, and Agentic AI, exploring their evolution and critical cybersecurity applications.
Splunk Security Content for Threat Detection & Response: November 2025 Update
Security
5 Minute Read

Splunk Security Content for Threat Detection & Response: November 2025 Update

Learn about the latest security content from Splunk.
Operation Defend the North: What High-Pressure Cyber Exercises Teach Us About Resilience and How OneCisco Elevates It
Security
3 Minute Read

Operation Defend the North: What High-Pressure Cyber Exercises Teach Us About Resilience and How OneCisco Elevates It

The OneCisco approach is not about any single platform or toolset; it's about fusing visibility, analytics, and automation into a shared source of operational truth so that teams can act decisively, even in the fog of crisis.
Data Fit for a Sovereign: How to Consider Sovereignty in Your Digital Resilience Strategy
Security
5 Minute Read

Data Fit for a Sovereign: How to Consider Sovereignty in Your Digital Resilience Strategy

Explore how digital sovereignty shapes resilient strategies for European organisations. Learn how to balance control, compliance, and agility in your data infrastructure with Cisco and Splunk’s flexible, secure solutions for the AI era.