ON THIS PAGE
Configuring the TTL Value for DNS Server Caching
This section describes how to configure the TTL value for a DNS server cache to define the period for which DNS query results are cached.
Requirements
No special configuration beyond device initialization is required before performing this task.
Overview
The DNS name server stores DNS query responses in its cache for the TTL period specified in the TTL field of the resource record. When the TTL value expires, the name server sends a fresh DNS query and updates the cache. You can configure the TTL value from 0 to 604,800 seconds. You can also configure the TTL value for cached negative responses. Negative caching is the storing of the record that a value does not exist. In this example, you set the maximum TTL value for cached (and negative cached) responses to 86,400 seconds.
Topology
Configuration
Procedure
Step-by-Step Procedure
To configure the TTL value for a DNS server cache:
Specify the maximum TTL value for cached responses, in seconds. (In this example, 86400 seconds equals 24 hours.)
[edit] user@host# set system services dns max-cache-ttl 86400
Specify the maximum TTL value for negative cached responses, in seconds.
[edit] user@host# set system services dns max-ncache-ttl 86400
If you are done configuring the device, commit the configuration.
[edit] user@host# commit
Verification
To verify the configuration is working properly,
enter the show system services
command.