0

So I have a lab with a DC running a DNS Server. I was wondering if there's a way to set TTL values for 'A' - type DNS records before they are created.

For example, if execute ping www.google.com, the DNS server caches the corresponding record for 5min (or even less) - I want that to be cached for at-least one day.

Is there a way to configure the DNS server to cache the records for a longer period of time (before the records are created)?

3
  • Are you asking about records for which the DNS server is authoritative, or about records which the DNS server resolves through other servers? Mar 13, 2022 at 14:27
  • @user1686 DNS Records which the DNS server resolves through other servers Mar 13, 2022 at 14:32
  • You said the opposite in harrymc's comments though... Mar 13, 2022 at 19:32

1 Answer 1

0

You could try the PowerShell command of Set-DnsServerCache:

Set-DnsServerCache -MaxTTL 01.00:00:00

This sets the maximum TTL to one day. For negative DNS answers, use the -MaxNegativeTtl parameter.

However, as the resolved DNS entries arrive from the outside DNS servers with their own TTL attached, I'm unsure that this will be enough. The documentation also states that the default setting is already one day.

You will have to try - many DNS cache mechanisms ignore the received TTL and use their own instead. But I think it's unlikely that DNS Server is one of them.

If this doesn't work, try also the parameter -IgnorePolicies of the Set-DnsServerCache command. Another useful parameter might be -LockingPercent, if it accepts a value larger than 100 percent.

2
  • Increasing the MaxTTL param won't just set an upper bound? How will it help increase the TTL of records? Just to be clear - I wish the expand the TTL of my records (not after they created, setting some minimum lower bound t such every TTL will make t <= TTL) Mar 13, 2022 at 17:48
  • Yes, it will set an upper bound and will only works if the server ignores the TTL (some servers ignore TTL entirely). If the DNS Server doesn't ignore TTL, you may try the other overriding verbs. Unfortunately, the documentation is extremely vague about what exactly these verbs do.
    – harrymc
    Mar 14, 2022 at 20:52

You must log in to answer this question.

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