powershell Command not recognized in the cmdlet to remove the DNS

Vedanth Pulipati 241 Reputation points
2022-05-30T10:31:31.907+00:00

I am using the below PowerShell command to remove the DNS record but facing error not recognized in the cmdlet tried to install dnsserver module but couldn't able to resolve the error

Command used:

Remove-DnsServerResourceRecord -ZoneName "contoso.com" -RRType "A" -Name "Host01" -RecordData "10.17.1.41"

Error :206714-image.png

Windows for business Windows Server User experience PowerShell
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Olaf Helper 47,436 Reputation points
    2022-05-30T10:50:53.54+00:00

    You have to import the module DnsServer first

    Import-Module DnsServer  
    

    And that requires the server has the DnsServer role, see
    https://learn.microsoft.com/en-us/powershell/module/dnsserver/?view=windowsserver2022-ps


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.