Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

close
keyboard_arrow_left
list Table of Contents
file_download PDF
{ "lLangCode": "en", "lName": "English", "lCountryCode": "us", "transcode": "en_US" }
English
keyboard_arrow_right

Configuring the TTL Value for DNS Server Caching

date_range 09-Nov-21

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:

  1. Specify the maximum TTL value for cached responses, in seconds. (In this example, 86400 seconds equals 24 hours.)

    content_copy zoom_out_map
    [edit]
    user@host# set system services dns max-cache-ttl 86400
    
  2. Specify the maximum TTL value for negative cached responses, in seconds.

    content_copy zoom_out_map
    [edit]
    user@host# set system services dns max-ncache-ttl 86400
    
  3. If you are done configuring the device, commit the configuration.

    content_copy zoom_out_map
    [edit]
    user@host# commit
    

Verification

To verify the configuration is working properly, enter the show system services command.

external-footer-nav