I was wondering how I would be able to delete my entire DNS server configuration, including all DNS records on Windows Server 2012 r2. Is there a built in command or an available script to accomplish this?
1 Answer
If you have an up-to-date Powershell (and if you're on a remote computer, RSAT), and you want to ditch EVERY DNS record from a zone, and you feel like shooting yourself in the foot:
Import-Module DnsServer
Get-DnsServerResourceRecord -ComputerName dc01 -ZoneName ad.example.com | Remove-DnsServerResourceRecord
That will delete every record from the ad.example.com
zone from the DNS server dc01
(which will then replicate to other DNS servers in the domain if you have AD replication enabled).
One has to ask why you want to delete every single record from your DNS server. That's usually a really good way to break things really badly.