DNS and Domain Investigation
The Domain Name System is both an investigative resource and an adversary tool, used for attribution, fast-flux evasion, and command-and-control communication. This topic covers DNS record types, WHOIS and passive-DNS querying, and common attacker abuse patterns investigators encounter.
Last updated:
DNS investigation is the practice of querying and analysing Domain Name System records, registration data, and historical resolution logs to attribute cyber activity, map attacker infrastructure, and support criminal proceedings. Every internet-connected device relies on DNS to translate human-readable names into IP addresses, which means every connection leaves a trail of queries that investigators can recover. DNS record types such as A, MX, NS, CNAME, and TXT each expose different facets of how a domain is used. WHOIS registration data identifies the registrant of a domain. Passive DNS databases capture the historical mapping between domain names and IP addresses, allowing investigators to reconstruct infrastructure that an attacker has already taken down or reconfigured.
Attackers exploit DNS in several well-documented ways. Fast-flux networks rotate A records through pools of compromised hosts to defeat IP-based blocking. Domain generation algorithms produce thousands of pseudo-random domains daily so that malware can reach its command-and-control server even if most of the domain list is blocked. DNS tunnelling encodes data inside query and response strings to exfiltrate information through firewalls that permit DNS traffic. Understanding these techniques is a prerequisite to both detecting them in network logs and explaining them to a court.
The investigative process follows a structured sequence: identify the domain or IP anchor, query live DNS and registration data, pivot through passive DNS to find related infrastructure, correlate with threat intelligence feeds, and document the chain of evidence under applicable law. Investigators across India, the US, the UK, and the EU operate under different data-retention regimes and mutual assistance frameworks, but the underlying DNS evidence is the same: records that a domain resolved to a given IP at a given time are among the most durable artefacts in a cyber case.
By the end of this topic you will be able to:
- Identify the DNS record types relevant to a cyber investigation and explain what each record reveals about domain infrastructure.
- Conduct a structured WHOIS and passive-DNS query workflow to map a domain's registration history and historical IP associations.
- Explain fast-flux, double-flux, domain generation algorithms, and DNS tunnelling, and describe the indicators that distinguish each in a query log.
- Apply pivot analysis to link multiple domains and IP addresses belonging to the same attacker campaign.
- Describe the legal mechanisms for obtaining DNS and WHOIS evidence in India, the US, the UK, and across borders via mutual legal assistance.
- A record
- A DNS resource record that maps a domain name to an IPv4 address. The primary attribution record in most investigations. An AAAA record performs the same function for IPv6 addresses.
- Passive DNS
- A historical database of DNS resolutions collected by sensors at recursive resolvers or network taps. Passive DNS shows which IP addresses a domain resolved to in the past and when, enabling investigators to reconstruct attacker infrastructure after it has changed.
- Fast-flux
- An evasion technique in which a domain's A records cycle through a large pool of IP addresses with very short TTL values. Double-flux additionally rotates the NS records. Both techniques make takedown significantly harder.
- Domain generation algorithm (DGA)
- Code embedded in malware that produces a large set of pseudo-random domain names on a scheduled basis. The malware tries each until one resolves, connecting it to command-and-control infrastructure even if most of the domain list has been blocked.
- DNS tunnelling
- A technique that encodes data inside DNS query strings or TXT/CNAME response records to carry non-DNS traffic through firewalls that permit DNS. Used for data exfiltration and C2 communication in environments with strict egress filtering.
- WHOIS
- A query protocol that returns registration data for a domain, including registrant name, organisation, email, nameservers, and registration and expiry dates. Since ICANN's GDPR alignment policy took effect in 2018, much registrant contact data for .com and other gTLDs is redacted by default in public queries.
DNS record types and their investigative value
DNS is a distributed database that answers one core question: what IP address corresponds to this name? But the database holds many record types beyond simple name-to-address mappings, and each type exposes a different facet of how a domain is configured and used. Investigators who understand the full record set can extract far more attribution data from a single domain query than one who only looks at the A record.
| Record type | Maps or contains | Investigative use |
|---|---|---|
| A | Domain to IPv4 address | Primary host attribution; TTL reveals fast-flux when very short |
| AAAA | Domain to IPv6 address | IPv6 infrastructure attribution; often overlooked in manual queries |
| MX | Domain to mail server hostname | Identifies phishing and spam infrastructure; shared MX ties campaigns |
| NS | Domain to authoritative nameserver | Nameserver reuse links domains across campaigns; rotated in double-flux |
| CNAME | Domain alias to canonical name | Reveals CDN or bulletproof-host relationships; masks true origin IP |
| TXT | Arbitrary text | SPF/DKIM/DMARC fingerprint email infra; C2 data encoded here in DNS tunnelling |
| SOA | Zone authority and serial | Zone serial changes reveal when a domain's DNS was last modified |
The TTL (time-to-live) field on any record is an underused forensic indicator. A legitimate CDN or enterprise domain typically sets TTL values between 300 and 3600 seconds. Fast-flux domains frequently use values of 60 seconds or less because they need resolvers to re-query quickly as the IP pool rotates. When a domain's A record TTL is below 120 seconds and the record changes on every query, that combination is a strong indicator of fast-flux operation.
WHOIS querying and registration data
WHOIS returns the registration record for a domain: who registered it, when, through which registrar, what nameservers it uses, and when it expires. Before May 2018, public WHOIS for gTLDs often included full registrant name, postal address, phone number, and email. After ICANN aligned its policies with the EU's General Data Protection Regulation, most registrars began redacting personal contact data from public responses. The underlying data still exists at the registrar but requires a formal legal request to access.
Even with redacted contact data, WHOIS records remain investigatively useful. The registrar itself, the nameservers assigned, the registration date, and the registrant organisation field (when present) can all serve as pivot points. A cluster of domains registered on the same date, through the same registrar, pointing to the same nameservers is a strong signal of a coordinated campaign, even if the registrant contact is redacted. The RDAP protocol (Registration Data Access Protocol) is the modern replacement for WHOIS and provides structured JSON output that is easier to process programmatically.
Country-code TLDs such as .in, .uk, and .de are administered by national registries with their own WHOIS policies. India's .in domains are managed by the National Internet Exchange of India (NIXI). UK domains under .co.uk are managed by Nominet, which provides a tiered WHOIS service with fuller data available to accredited law enforcement. Investigators must identify the correct registry for the TLD before querying, as a gTLD WHOIS server will not have data for ccTLD domains.
Passive DNS and historical resolution analysis
Passive DNS databases are built by organisations that operate large recursive resolvers or that deploy sensors across network infrastructure. Every time one of those resolvers answers a query, the resolution, the domain queried, the answer returned, and the timestamp are stored. Over time, these databases accumulate resolution histories for hundreds of billions of domains. Commercial providers including Farsight Security DNSDB, VirusTotal passive DNS, and RiskIQ (now part of Microsoft Defender) offer investigator access.
The core investigative pivot in passive DNS is the IP-to-domain lookup, also called a reverse passive DNS query. Given an IP address, the query returns all domains that resolved to that IP over the collection period. If a phishing domain resolves to an IP and an investigator reverse-queries that IP, they may find dozens of other domains that used the same host at different times, each potentially part of the same campaign. Conversely, a domain-to-IP query shows all IPs that the domain has resolved to, which may span multiple hosting providers and time periods.
Timeline reconstruction from passive DNS is particularly powerful in cases involving infrastructure migration. Attackers frequently move domains between hosts, either after detection or as a planned rotation. A passive DNS timeline showing a domain at IP A for three weeks, then at IP B, then at IP C, combined with threat intelligence about those IPs, can establish both the duration of a campaign and its operational security patterns.
Attacker abuse patterns: fast-flux, DGA, and DNS tunnelling
Three DNS abuse patterns appear repeatedly in cyber investigations and each has a distinct signature in query logs.
Fast-flux networks use DNS TTL values as short as 60 seconds and rotate A records through a pool of compromised hosts, each acting as a proxy for the actual backend server. The technique was widely used by the Storm botnet from 2007 onward and remains common in malware distribution and phishing campaigns. Detection in logs requires correlating short TTL values with high change frequency on the same domain. Double-flux additionally rotates NS records, which means the domain's authoritative nameservers themselves change frequently, making registrar-level takedown more complex because there is no stable NS to target.
Domain generation algorithms produce a deterministic but externally unpredictable list of domain names based on a seed value, often the current date. The Conficker worm (2008) generated 250 domains per day. Later families such as Cryptolocker (2013) and Mushtik generated thousands per day. Investigators detect DGA traffic by analysing DNS query logs for bursts of queries to non-resolving high-entropy domains. Reverse-engineering the malware to extract the DGA seed and schedule allows analysts to predict future domains and apply for pre-emptive sinkhole orders.
DNS tunnelling encodes data in the subdomain label of a query. A tool like Iodine or DNScat will convert a file or a shell session into a series of queries such as aGVsbG8gd29ybGQ.attacker-c2.com, where the base64-encoded string in the subdomain carries the payload. The response carries data back in TXT or CNAME records. Detection indicators include: query length far above the median for the domain (legitimate subdomains rarely exceed 20 characters), high query rate to a single second-level domain, and a high proportion of TXT record queries from a single endpoint.
Infrastructure pivoting: linking domains and IP addresses
Attribution in cyber investigations rarely comes from a single record. It comes from building a graph of relationships between domains, IP addresses, nameservers, registrant data, and TLS certificates, and identifying the nodes that connect multiple campaigns to the same actor. This process is called infrastructure pivoting.
A structured pivot workflow begins with the initial indicator, typically a domain or IP from a phishing email, malware sample, or incident report. From that anchor, the investigator queries: (1) all IP addresses the domain has resolved to via passive DNS; (2) all domains that have resolved to each of those IPs; (3) WHOIS registration data for each discovered domain, noting shared registrant email, nameserver, or registrar; (4) TLS certificate transparency logs, which record every SSL certificate issued for a domain and often reveal subdomains and related domains that share the same certificate or the same issuing account. Tools such as Shodan, Censys, and RiskIQ automate parts of this pivot chain.
Certificate transparency logs are a particularly underused resource. Since 2018, all publicly trusted TLS certificates must be logged in public CT log servers before browsers will accept them. When an attacker creates infrastructure for a new campaign, issuing a certificate creates a permanent, timestamped public record. Querying CT logs for a known attacker domain sometimes reveals sibling domains that were not yet known to threat intelligence. Services such as crt.sh provide free access to the consolidated CT log database.
Pivot analysis for attribution is also relevant to the Indicators of Compromise workflow. Domains and IPs discovered through pivoting become IOCs that can be shared with other organisations, ingested into SIEM systems, and incorporated into threat intelligence products. The STIX 2.1 standard supports domain-name and URL objects with relationship links to IP addresses, enabling structured sharing of pivot chains.
Legal frameworks and evidence collection
DNS evidence takes two main forms: live query results obtained by the investigator, and stored records held by ISPs, registrars, or DNS service providers. Live query results are generally self-obtained and do not require a court order, but the investigator must document the query methodology, the tool used, the timestamp, and the resolver IP to establish authenticity. Stored records held by third parties require legal process in the jurisdiction where those records are held.
In India, DNS query logs held by internet service providers can be obtained under Section 91 of the Bharatiya Nagarik Suraksha Sanhita 2023 (which replaced the Code of Criminal Procedure), which allows a court or an officer in charge of a police station to require production of documents. The Information Technology Act 2000, Section 69, authorises the government to direct interception, monitoring, or decryption of information through a computer resource, and Section 79A designates agencies as Examiners of Electronic Evidence whose reports are admissible under the Bharatiya Sakshya Adhiniyam 2023.
In the US, DNS records held by ISPs are stored communications subject to the Stored Communications Act (18 USC 2701 et seq.). Non-content subscriber records can be obtained with a subpoena; content and more sensitive records require a court order or warrant. In the UK, the Investigatory Powers Act 2016 governs access to communications data held by internet service providers. In the EU, national implementations of the e-Privacy Directive set data retention obligations, though the Court of Justice of the EU has repeatedly constrained bulk retention requirements in cases including Digital Rights Ireland (2014) and La Quadrature du Net (2020).
Cross-border requests use Mutual Legal Assistance Treaties. A domain hosted in the US but accessed by victims in India requires the Indian Central Authority (the Ministry of Home Affairs) to submit an MLA request to the US Department of Justice. MLAT timelines typically range from several months to over a year, which means investigators should pursue all open-source passive DNS and CT log data before or in parallel with formal requests, to avoid delays in building the initial picture.
An analyst observes that a suspicious domain has A record TTL values of 60 seconds and the IP address changes on every query. Which attacker technique does this most likely indicate?
Key Takeaways
- DNS record types beyond the A record, including MX, NS, TXT, and CNAME, each expose different facets of domain infrastructure and serve as pivot points in attribution analysis.
- Passive DNS databases provide historical resolution data that survives attacker infrastructure migration; reverse passive DNS queries on a hosting IP are among the fastest ways to find related malicious domains.
- Fast-flux is identified by very short TTL values combined with rapid IP rotation; DGA traffic shows as high-volume queries to high-entropy, non-resolving domains; DNS tunnelling appears as unusually long subdomains and a high rate of TXT record queries from a single host.
- Certificate transparency logs record every publicly trusted TLS certificate and provide a timestamped, publicly accessible pivot to subdomains and sibling domains that may not yet appear in passive DNS.
- DNS evidence collection must follow applicable law: India's Bharatiya Nagarik Suraksha Sanhita 2023 and IT Act 2000, the US Stored Communications Act, the UK Investigatory Powers Act 2016, and EU data retention frameworks all impose different obligations on investigators and custodians.
What is passive DNS and why do investigators use it?
What is a fast-flux network and how does DNS enable it?
What DNS record types are most useful in a cyber investigation?
What is a domain generation algorithm (DGA) and how do investigators detect it?
What legal frameworks govern DNS evidence collection across jurisdictions?
Test yourself on Cyber Forensics with free, timed mocks.
Practice Cyber Forensics questionsSpotted an error in this page? Report a correction or read our editorial standards.