Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

share|improve this question
add comment

1 Answer

up vote 2 down vote accepted

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).

share|improve this answer
    
Thanks. I just found out the script we use to add RRs to the zone is enforcing 86400 as the TTL for each record. I ran a test by adding a new record for an existing zone and set the ttl to 3600. It wrapped it in two $TTL statements (one to set it to 3600 and one to reset it to 86400 after). So that confirms it! –  Yanick Girouard Sep 24 '13 at 14:50
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.