Hi all,
the script in the link below is correct? Can anyone share? Thank you!
https://serverfault.com/questions/626092/converting-dynamic-dns-records-to-static
Hi all,
the script in the link below is correct? Can anyone share? Thank you!
https://serverfault.com/questions/626092/converting-dynamic-dns-records-to-static
Why don't you pick one A record and just run the Get-/Set-DndServerRecord with that?
The problem is that if the host updates the record after that (because it's configured that way) it'll probably set a new timestamp on the record. You should check to see if the box that says to delete the record when it becomes stale is checked on the A record after it's been modified (assuming that you're trying to prevent the record from being scavenged).
@RichMatheisen-8856 what exactly $_ mean after -OldInputObject & -NewInputObject ? Thank you!
It's a reference to the "current object" in the pipeline.
@RichMatheisen-8856 what exact value of the current object in the example of the link? Thank you!
Hi there,
Assuming you still have the DHCP server in place, then you should not need to do this. Windows should be regularly updating the DHCP lease. if nothing else, reboot the server.
If you're using Windows DNS you can try using the cmdlet Set-DnsServerResourceRecord from the DnsServer module:
$NewObj = $OldObj = Get-DnsServerResourceRecord -Name "Host01" -ZoneName "contoso.com" -RRType "A"
$NewObj.TimeToLive = [System.TimeSpan]::FromHours(2)
Set-DnsServerResourceRecord -NewInputObject $NewObj -OldInputObject $OldObj -ZoneName "contoso.com" -PassThru
How to Convert a Dynamic Resource Record to a Static One Without Re-Creating it in DNS https://social.technet.microsoft.com/wiki/contents/articles/21726.how-to-convert-a-dynamic-resource-record-to-a-static-one-without-re-creating-it-in-dns.aspx
--If the reply is helpful, please Upvote and Accept it as an answer–
19 people are following this question.