-1

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?

2
  • Your question says "2012" but your tag says "2012 R2". Which one is it? Commented Jun 2, 2017 at 13:59
  • 2012 r2. I will update my question for future references Commented Jun 2, 2017 at 14:07

1 Answer 1

3

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.

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .