IBM Support

Configuring time to live (TTL) for the negative responses from DNS

How To


Summary

Netcd (network caching daemon) is used to cache the responses from the network services like DNS, LDAP,NIS. If netcd is configured only the first query for specific host goes to external server like DNS, NIS etc, whatever answer is received is cached in the netcd cache and it stays in the cache until a time to live TTL returned the external server. So when the same query is made again resolver will query the netcd cache and gives back to the application.

Objective

Q. how to configure the TTL values for negative responses ?
A. It can be configured via  /etc/netcd.conf. TTL for negative responses is made configurable after AIX 7100-05 and AIX 7200-02. 
 

Steps

The line from /etc/netcd.conf in the following format can be edited to handle the TTL for negative responses 
Change this:
cache <type_of_cache> <type_of_map> <hash_size> <cache_ttl>
to:
cache <type_of_cache> <type_of_map> <hash_size> <cache_ttl>:<negative cache_ttl> 
Examples:
    "Cache dns hosts 128"         obey the TTL from dns server for positive and negative responses
    "Cache dns hosts 128 20"     overwrite the TTL from dns server for positive and negative responses
    "Cache dns hosts 128 20:30" overwrite the TTL from dns server for positive and negative responses with different TTL values
    "Cache dns hosts 128 0:20"     overwrite the TTL from dns server for negative response only
    "Cache dns hosts 128 20:0"     overwrite the TTL from dns server for positive response only
    "Cache dns hosts 128:"         ERROR
    "Cache dns hosts 128 20:"     ERROR
    "Cache dns hosts 128: 20"     ERROR

NOTE: TTL values if configured in netcd.conf overrides the values returned by server. 
 

Additional Information

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Author: Mayank Sonakiya
Operating System: AIX and VIOS
Hardware: Power
Feedback: aix_feedback@wwpdl.vnet.ibm.com, msonakiy@in.ibm.com
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Document Location

Worldwide

[{"Line of Business":{"code":"LOB08","label":"Cognitive Systems"},"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SWG10","label":"AIX"},"ARM Category":[],"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"All Version(s)"}]

Document Information

Modified date:
04 November 2021

UID

ibm16339579