3

So I mistakenly create a cname record in my Windows 2019 server. It is set in this naming context -

server.company.local.company.local

I know, silly mistake. It does not show up in DNS mmc but does in powershell. I cannot delete it from powershell though. Can anyone help?

1
  • 1
    Can you post a screenshot of how this record actually appears on your DNS manament console?
    – Massimo
    Apr 22, 2020 at 23:19

1 Answer 1

2

Hello according to the Microsoft documentation, you have to use the following syntax :

Remove-DnsServerResourceRecord -ZoneName "company.local" -RRType "CName" -Name "server.company.local.company.local."

According to what @Massimo says the -Name parameter has to have a dot at the end of the name. It is to prevent the command to add the ZoneName to the Resource record.

So you can check out more information in this website https://docs.microsoft.com/en-us/powershell/module/dnsserver/Remove-DnsServerResourceRecord?view=win10-ps but remember when you have an Add Verb most of the time you will have a Remove Verb too.

6
  • Thanks but I tried that already and it doesn't work. Getting "Failed to get x.local.x.local record in x.local zone on x server. Apr 22, 2020 at 18:44
  • Please share more information about giving the output of the cmdlet Get-DnsServerResourceRecord -Zone "you-zone-name" -RRType "CName". Probably that command can give us better information about the error.
    – allexiusw
    Apr 22, 2020 at 22:41
  • 1
    Have you tried adding a dot to the end of the record?
    – Massimo
    Apr 22, 2020 at 23:18
  • Here is the screenshot: i.postimg.cc/BQ2Ysg12/cname-error.png Apr 24, 2020 at 15:28
  • Thanks Massimo, adding the . at the end of the record did it. Thank you! Apr 24, 2020 at 15:31

You must log in to answer this question.

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