Multiple $TTL statements in bind DNS zone file

binddomain-name-systemsolaristtl

I'm using a socks proxy to connect to servers using another application. The proxy, which runs on Solaris 10. The server hosting the proxy is configured to use our own internal DNS server (bind) to resolve internal hostnames.

Sometimes, we need to change the IP address of our internal servers, and for some reason it can take more than 1 hour for the socks proxy to see the new IP address. We were told by the vendor of the product that it's using the OS's DNS resolver and doesn't have any DNS cache of its own.

Our internal DNS has a single DNS zone with multiple sub-zones in it. And I noticed it has a default $TTL of 1 hour set at the beginning, but for one of the sub-zones, it's set again to 1 day. See below for an example:

$ORIGIN .
$TTL 3600       ; 1 hour
mydomain                IN SOA  dns1.sub1.mydomain. dnsadmin.mydomain.com. (
                          2009077402 ; serial
                          3600       ; refresh (1 hour)
                          900        ; retry (15 minutes)
                          604800     ; expire (1 week)
                          10800      ; minimum (3 hours)
                        )
                        NS      dns1.sub1.mydomain.
                        NS      dns2.sub1.mydomain.
$ORIGIN sub1.mydomain.
dns1                    A       10.0.0.1
dns2                    A       10.0.0.2
server3                 A       10.0.0.3
server4                 A       10.0.0.4
server5                 A       10.0.0.5
server6                 A       10.0.0.6
server7                 A       10.0.0.7
server8                 A       10.0.0.8
$ORIGIN sub2.mydomain.
$TTL 86400      ; 1 day
server1                 A       10.0.1.1
server2                 A       10.0.1.2
server3                 A       10.0.1.3
server4                 A       10.0.1.4
server5                 A       10.0.1.5
server6                 A       10.0.1.6
server7                 A       10.0.1.7
server8                 A       10.0.1.8
$ORIGIN sub3.mydomain.
server1                 A       10.0.2.1
server2                 A       10.0.2.2
server3                 A       10.0.2.3
server4                 A       10.0.2.4
server5                 A       10.0.2.5
server6                 A       10.0.2.6
server7                 A       10.0.2.7
server8                 A       10.0.2.8

In this example, would the $TTL value be changed to 1 day only for the sub2 subdomain or would it be changed for everything below it as well?

This is a production server, so you'll understand I want to make sure of the behaviour before I change it (remove the second $TTL) and can't really just "try it". I don't have a dev DNS server to try it on either.

I've checked the doc for the zone file and it doesn't mention what happens when more than one $TTL statement is encountered in the same zone file, or at least I can't find it if it does.

Any help would be appreciated.

Best Answer

http://ipamworldwide.com/index.php?option=com_content&view=article&id=88:bind-zone-file-directives&catid=48:dns-isc

The verbiage on the above site seems to imply that the TTL will be applied to any records following the $TTL directive (that don't have an explicit TTL in the record).

Related Topic