Monitor Active Directory (AD) DNS zones for new domain names and DNS entries that may indicate unauthorized hosts, attacker infrastructure, or persistence mechanisms.
Given:
All new DNS zone records are discovered, recorded, validated, and confirmed as authorized or escalated.
This task can be repetitive. Operators should automate where possible:
.txt
or .csv
Get-WmiObject -Namespace root\MicrosoftDNS -Class MicrosoftDNS_ResourceRecord |
Select-Object __Class, ContainerName, DomainName, RecordData, OwnerName |
Out-GridView
Get-WmiObject -Namespace root\MicrosoftDNS -Class MicrosoftDNS_ResourceRecord |
Where-Object {$_.DomainName -eq "..roothints"} |
Out-GridView
Get-DnsServerResourceRecord -ZoneName "corp.example.com" |
Select-Object HostName, RecordType, RecordClass, RecordData |
Export-Csv "C:\Monitor\AD_DNS_Snapshot.csv" -NoTypeInformation
Compare-Object -ReferenceObject (Get-Content C:\Monitor\AD_DNS_Snapshot.csv) `
-DifferenceObject (Get-Content C:\Monitor\AD_DNS_Snapshot_2.csv)
Operator Note: Schedule export + compare daily → alert if diff found
aws route53 list-resource-record-sets --hosted-zone-id ZONEID
Get-AzDnsRecordSet -ResourceGroupName "RG" -ZoneName "example.com"
gcloud dns record-sets list --zone="example-zone"
Operator Note: New external-facing records (e.g. subdomains) → high risk → verify owners
Operators should automate periodic snapshots and compare results daily or weekly.
# Example Scheduled Task
powershell.exe -File C:\Scripts\Monitor_AD_DNS.ps1
Tool | Platform | Installation | Usage |
---|---|---|---|
DNS Console (Export List) | Windows | Native | Manual export |
PowerShell DNS Cmdlets | Windows | Native | Automated export + compare |
Kdiff / WinMerge | Cross-platform | Installable | Manual compare |
AWS Route53 CLI | AWS | Native | DNS record export |
Azure CLI DNS | Azure | Native | DNS record export |
GCP gcloud DNS | GCP | Native | DNS record export |
Date | Version | Description | Author |
---|---|---|---|
2025-05-02 | 1.0 | Original retained + expanded to include automation, cloud DNS, operator procedures | Leo |