Hello,
I have a multiple “ARecordData” IP address (IPv4) which a identical and has to be removed via powerhshell command. Can some one help in the same ? I need a command that deletes all these unused ArecordData when a Server is terminated.
Generally when a server is terminated in AWS EC2 instances, the ARecordData still remains in the DNS. I want it to be auto deleted - may be ill create a ps1 file and put in execution under a Lambda function.
I got the below code from your forum. Needs a bit more tweek.
Remove-DnsServerResourceRecord -ComputerName “x.x.x.x” -ZoneName “example.com” -RRType A | select hostname,@{label=‘IP Address’; expression={$_.recorddata -contains ‘10.0.0.12’| select -expandproperty ipv4address}} | ft -AutoSize
Here I want to delete all the IP’s in ARecordData which has “10.0.0.12”
Please help