Ingesting, analyzing, and visualizing DNS logs using Splunk & Zeek
This project demonstrates how to ingest, parse, and analyze DNS logs using Splunk Enterprise.
Using Zeek-style JSON DNS logs, we perform security-focused DNS traffic analysis with Splunk Search Processing Language (SPL).
The project helps in identifying:
- Frequently queried domain names
- Most active client IPs
- DNS query type distribution
- Potential anomalies in DNS behavior
By completing this project, you will learn how to:
- Ingest JSON-formatted DNS logs into Splunk
- Extract useful DNS metadata (queries, IPs, record types)
- Write SPL queries for DNS traffic analysis
- Detect suspicious or abnormal DNS activity
- Build a foundation for DNS-based threat detection
- Splunk Enterprise
- Zeek DNS Logs (JSON format)
- Search Processing Language (SPL)
The dataset consists of Zeek-style DNS logs in JSON format containing the following fields:
ts β Timestamp
id.orig_h β Source IP address
id.resp_h β DNS server IP
qtype β DNS query type (A, AAAA, PTR, CNAME)
query β Queried domain name
answers β DNS response
rcode β DNS response code
rtt β Round Trip Time
- Open Splunk Web
- Navigate to:
Settings β Add Data β Upload
- Select the file:
dns_logs.json
- Configure:
- Source Type:
json(or customzeek:dns) - Index: create a new index like
dns_lab(recommended)
Run the following SPL query:
index=dns_lab | head 5
Identify the domains queried most often.
index=dns_lab
| stats count by query
| sort -count
Use Case: Detect suspicious domains, beaconing behavior, or malware C2 traffic.

Find hosts generating the highest DNS traffic.
index=dns_lab
| stats count by "id.orig_h"
| sort -count
Use Case: Identify compromised systems or misconfigured devices.

Analyze DNS record types in the environment.
index=dns_lab
| stats count by qtype
Common Types:
Aβ IPv4 address lookupAAAAβ IPv6 address lookupCNAMEβ Canonical name mappingPTRβ Reverse DNS lookup
- Identified top queried domains (e.g., Google, Microsoft, Yahoo)
- Discovered high-volume DNS-generating client IPs
- Observed distribution of A, AAAA, CNAME, and PTR records
- Analyzed response time (RTT) and failed DNS resolutions
- Established a baseline for DNS behavior
This analysis can help detect:
- DNS tunneling
- Malware beaconing via repeated DNS queries
- Excessive reverse DNS lookups
- High-latency or failed DNS responses
- Rare or suspicious domain queries
Future improvements may include:
-
Splunk dashboards for DNS activity visualization
-
Alerts for:
- High DNS query volume
- NXDOMAIN spikes
- Rare or newly observed domains
By completing this project, you have:
- Successfully ingested and parsed DNS logs in Splunk
- Built SPL queries for DNS traffic analysis
- Identified key DNS usage patterns
- Gained hands-on experience in SIEM-based security analysis
This project is well-suited for SOC Analyst, Cybersecurity, and SIEM roles.
- GeoIP enrichment for DNS responses
- DNS tunneling detection using entropy analysis
- Correlation with HTTP or proxy logs
- Automated alerting and reporting
β If you found this project helpful, consider starring the repository!
