Powershell to update TTL of multple A Records from a file, each A record having multiple IP's

Biju Thankappan 86 Reputation points
2022-01-24T01:39:19.46+00:00

Hi,

I'm referring to the below article from MS. However, the ttl values do not update as expected even after using the same commands as per this article:

https://learn.microsoft.com/en-us/powershell/module/dnsserver/set-dnsserverresourcerecord?view=windowsserver2022-ps

Few queries:

How to update the tl for A records having multiple IP's?

Does the ttl values updated for soa record ensure new records are updated with this updated ttl value?

Regards,

TIA

Windows for business | Windows Client for IT Pros | Networking | Network connectivity and file sharing
Windows for business | Windows Server | User experience | PowerShell
0 comments No comments
{count} votes

Accepted answer
  1. Rich Matheisen 47,901 Reputation points
    2022-01-24T02:50:12.413+00:00

    "A" records don't have multiple IP addresses. What you have are multiple "A" records, each with their own IP address.

    Treat the results of the Get-DnsServerResourceRecord the same way you'd treat anything that returned (possibly) multiple objects:

    Get-DnsServerResourceRecord -Name BOGUS -ZoneName ATHOME.COM -RRType A |
        ForEach-Object{
            $NewRecord = $_.Clone()
            $NewRecord.TimeToLive = New-TimeSpan -hours 2
            Set-DnsServerResourceRecord -NewInputObject $NewRecord -OldInputObject $_ -ZoneName athome.com
        }
    

    The SOA record sets the minimum TTL for resource records. Whether that applies to new records only, or to all records in a zone, or to just all records in a zone that have a TTL lower than the SOA calls for I don't remember.

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful

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.