When a DNS incident hits, evidence collection from DNS history decides whether the post-mortem rests on facts or on guesses. Incident responders, SOC analysts and DNS administrators all run into the same problem. DNS changes all the time by design. Records get edited, caches expire, and the state that mattered at 02:14 on a Tuesday is often gone by the time someone opens a ticket. This article covers where historical DNS evidence lives, how to collect it so it holds up in an audit or legal review, and which mistakes quietly break a timeline.
Why DNS State Disappears So Fast
A record with a 300-second TTL leaves almost nothing in resolver caches five minutes later. The authoritative zone only shows the current state unless someone kept versions. An attacker who changed an A record through a compromised Cloudflare or GoDaddy account can change it back within an hour, and the live zone will look clean.
For that reason, DNS evidence has to come from several independent sources, not from the zone alone. Each source shows a different part of the picture: who changed what, what resolvers saw, and which certificates were issued in the meantime.
Where DNS History Evidence Actually Lives
An experienced incident responder works through five source types, starting with the one most likely to disappear:
– Provider audit logs – AWS CloudTrail logs Route 53 ChangeResourceRecordSets calls, Azure Activity Log covers Azure DNS, and Cloudflare keeps an audit log for each account. CloudTrail event history and Azure Activity Log both keep 90 days unless you export them.
– Passive DNS databases – DomainTools Farsight DNSDB, SecurityTrails, VirusTotal and Cisco Umbrella Investigate show which answers resolvers observed and when.
– Certificate Transparency logs – crt.sh and Censys list the certificates issued for a hostname. An attacker who has proved control of a name often shows up here first.
– Internal resolver logs – BIND query logs, Zeek dns.log or Infoblox reporting show which internal clients received the malicious answer.
– Your own zone snapshots – exported zone files, Terraform state, or the Git history of an OctoDNS or DNSControl repository.
Collect audit logs first. Their retention is short, and lower plan tiers sometimes keep even less. CT data is permanent and public, which makes it one of the most reliable independent witnesses, as covered in using CT logs as a discovery source. Your own snapshots are only as good as how often you take them. Teams that keep baseline snapshots of their zones can produce a clean before-and-after diff in minutes.
Reconstructing a Takeover Timeline From DNS History
Here is a pattern most security teams will recognize. A campaign subdomain, promo.example.com, has a CNAME pointing to an Azure App Service hostname. The campaign ends and the App Service is deleted, but nobody removes the CNAME. Weeks later, a customer reports a credential-harvesting page on that subdomain.
The zone change log shows nothing, because nobody touched the CNAME. That is the lesson: the evidence sits outside the DNS provider. The Azure Activity Log export shows the web app deletion on day 0. Passive DNS shows the target hostname resolving to a new IP address on day 9. On the same day, crt.sh shows a new certificate for promo.example.com that nobody inside the organization requested. The first customer report arrives on day 16.
That gives a 7-day exposure window. Proxy and resolver logs for that window then show which employees and customers resolved the name. The response steps that follow are described in recovering from a subdomain takeover.
Step-by-Step DNS Evidence Collection Procedure
Step 1 – Freeze the current state. Query the authoritative servers directly, for example dig +norecurse @ns1.provider.net promo.example.com ANY, and repeat the query for each record type. Save the raw output with a UTC timestamp, and export the full zone through the provider API.
Step 2 – Export audit logs right away. Pull CloudTrail, Azure Activity Log or Cloudflare audit entries for at least 30 days before the suspected start. Route 53 is a global service, so its CloudTrail events are recorded in us-east-1. Teams often search the wrong region.
Step 3 – Query passive DNS in both directions. Look up the hostname to see its historical answers. Then look up the target IP addresses or CNAME targets to see what else pointed there. Save the raw JSON, not screenshots.
Step 4 – Pull CT entries for the affected names and for wildcard certificates covering them.
Step 5 – Check internal resolver logs to scope affected clients.
Step 6 – Document chain of custody. Record who collected each artifact, when, from which source, and its SHA-256 hash. Store everything in write-once storage such as S3 Object Lock in compliance mode.
The Myth That Passive DNS Equals Zone History
Many responders treat passive DNS as a complete record of what a zone contained. It isn’t. Passive DNS only records answers that its sensor networks happened to observe. A low-traffic subdomain or an internal-only TXT record may never appear at all.
The first-seen and last-seen timestamps are observation times, not change times. If a record changed at 09:00 and nobody queried it through a sensor until 15:30, passive DNS reports 15:30. Missing data doesn’t prove a record never existed, and a first-seen date only gives the latest possible change time, not the actual one.
Common Mistakes That Break the Timeline
Fixing before capturing. Deleting the dangling CNAME or rolling back a hijacked record before anyone saves the live state destroys the most direct evidence. Capturing it takes about 10 minutes, and those 10 minutes rarely change the outcome.
Mixing time zones. Some dashboards show browser-local time, while CloudTrail and most passive DNS APIs use UTC. A two-hour offset can make a change look like it happened after the attack started. Convert every source to UTC before building the timeline.
Treating the SOA serial as a timestamp. The YYYYMMDDnn format is only a convention. Route 53 keeps the serial at 1 unless you change it, and other providers generate their own values. A serial shows that something changed, not when.
Edge Cases: Regulated, On-Prem and Small Teams
Under NIS2, essential and important entities have to send an early warning within 24 hours and an incident notification within 72 hours. That makes pre-exported audit logs an operational requirement, not a nice-to-have. Resolver logs contain client IP addresses, which count as personal data under GDPR. Keeping them for investigations has to be documented and balanced against data minimization.
On-premises BIND without a provider audit log has a useful source of its own. If dynamic updates are enabled, the .jnl journal files record incremental changes, and named-journalprint can read them. Air-gapped environments have no access to external passive DNS, so internal query logging is the only historical record.
Teams under 10 people don’t need a SIEM pipeline. A daily cron job that exports zones into a private Git repository gives them a dated history with almost no overhead.
FAQ
How long should DNS history be retained for incident response?
Keep at least 12 months of zone snapshots and audit logs. Takeovers based on forgotten records often start months after the original change, so 90 days of default retention is rarely enough.
Can passive DNS data be used as evidence in legal proceedings?
It can support a case, but it is third-party observational data. Use it alongside first-party audit logs, CT entries and hashed captures, and record exactly how and when you retrieved it.
Is free passive DNS data sufficient?
For a quick look, VirusTotal and the free SecurityTrails tier are often enough. Full historical depth and bulk API access usually require a paid subscription. That cost is easier to justify before an incident than during one.
Summary
DNS evidence goes stale within minutes, so collection has to start before the fix and draw on several independent sources: provider audit logs, passive DNS, CT logs, resolver logs and your own snapshots. Normalize everything to UTC, hash every artifact, and remember that passive DNS shows when sensors observed a record, not when it changed. Most importantly, start exporting zones and audit logs now, because the history you will need in the next incident has to be collected before that incident starts.
