Preventing Remote Name Servers from Caching a Resource Record

2.10.1 Problem

You want to prevent remote name servers from caching one or more records in your zone.

2.10.2 Solution

Give the record (or records) an explicit -- and low -- time to live (TTL). For example, to keep other name servers from caching your web server's addresses, you could add these A records to the zone data file: 1 IN A 1 IN A 1 IN A

Specify the explicit TTL between the domain name owner of the record and the class field. By default, the value is an integer number of seconds. You can also use a scaled value, as you would in the $TTL control statement.

2.10.3 Discussion

Note that the TTLs for the three A records are the same; that's no accident. If you were to use different TTLs for records in the same RRset (of the same type, and attached to the same domain name), a remote name server might age only some of them out, leading to unpredictable results. Consequently, modern name servers notice this misconfiguration and "trim" mismatched TTLs within a single RRset to the smallest TTL of the group.

Why did I use a TTL of one instead of zero? After all, a zero TTL would seem to say, "Don't cache this record." Unfortunately, TTLs of zero tickle a bug in some older name servers, which age out the records before returning them to the resolver that initiated the query. D'oh!

2.10.4 See Also

Section 2.2 for the syntax of scaled values, and "Changing TTLs" in Chapter 8 of DNS and BIND.

Getting Started

Zone Data

BIND Name Server Configuration

Electronic Mail

BIND Name Server Operations

Delegation and Registration


Interoperability and Upgrading

Resolvers and Programming

Logging and Troubleshooting


DNS & BIND Cookbook
DNS & BIND Cookbook
ISBN: 0596004109
EAN: 2147483647
Year: 2005
Pages: 220
Authors: Cricket Liu © 2008-2020.
If you may any questions please contact us: