I'm wondering if I need to clear some cache or something with the issue I'm having.
I'm trying to remove A records from a DNS Zone and replacing them with a CName record that has the same host name.
Remove-DnsServerResourceRecord -Zonename $line -InputObject $record -Force
Add-DnsServerResourceRecordCName -Zonename $line -Name $hostname -TimeToLive $ttl -HostNameAlias $target
This throws me:
Add-DnsServerResourceRecordCName : Failed to create resource record @ in zone zone.tld on server NS01. At C:\admin\updatettl.ps1:56 char:4 + Add-DnsServerResourceRecordCName -Zonename $line -Name $hostname > -TimeToLive ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : ResourceExists: (@:root/Microsoft/...urceRecordCName) > [Add-DnsServerResourceRecordCName] , CimException + FullyQualifiedErrorId : WIN32 9709,Add-DnsServerResourceRecordCName
Any ideas? Thanks