Set-DNSServerCache cmdlet

This topic contains 1 reply, has 2 voices, and was last updated by Profile photo of Thom Schumacher Thom Schumacher 3 months, 3 weeks ago.

  • Author
    Posts
  • #50807
    Profile photo of Michael Maher
    Michael Maher
    Participant

    Hi Folks,

    I'm trying to understand this syntax in the help for Set-DNSServerCache.

    The parameter MaxTTL is described as follows in the online help. I'm wondering how I should interpret the datatype

    -MaxTtl
    Specifies how many seconds (0x0-0xFFFFFFFF) a record is saved in cache. If you use the 0x0 setting, the DNS server does not cache records. The default setting is 0x15180 (86,400 seconds, or one day).
    https://technet.microsoft.com/en-us/library/jj649852.aspx

    It looks like I pass it the value in seconds but the information provided isn't really clear. I don't want to mess up my DC/DNS.

    Furthermore, if I run this cmdlet I get a different format

    Get-DnsServerCache -ComputerName localhost | Select MaxTTL, ZoneName
    MaxTTL      ZoneName                                                                                                                                         
    ------      --------                                                                                                                                         
    1.00:00:00  .   

    There is only one example provided for the Set-DNSServerCache cmdlet and it doesn't cover my use case.

    Does anyone know how to interpret this? I don't have a test W2012R2 DC to play with unfortunately

    Thanks,

    Michael

    • This topic was modified 3 months, 3 weeks ago by Profile photo of Michael Maher Michael Maher. Reason: included Technet url
  • #50838
    Profile photo of Thom Schumacher
    Thom Schumacher
    Participant

    The datatype for MAXTTL is of Type Timespan:

    c:\(get-dnsservercache).maxttl -is [timespan]
    True
     

    I believe to set that you can use the new-timespan cmdlet:
    http://go.microsoft.com/fwlink/?LinkId=821837

    Thom

You must be logged in to reply to this topic.