DekGenius.com
I l@ve RuBoard Previous Section Next Section

2.10 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:

www.foo.example.    1    IN    A    10.0.0.1
www.foo.example.    1    IN    A    10.0.0.2
www.foo.example.    1    IN    A    10.0.0.3

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 www.foo.example 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.

    I l@ve RuBoard Previous Section Next Section