Suggested dns patch

"Armand A. Verstappen" <[email protected]>
Newsgroups gmane.comp.isp.ispman.devel
Organization Envida
Message-ID <1091318172.8960.45.camel@diallo>
Hi,

When ISPMan writes a zonefile using dns.bind8.lib, it will write out
lines like:

www     1D      IN      A       192.168.0.1


The '1D' in there comes hardcoded from ISPMan. This '1D' is the time a
caching nameserver may assume that the value will not change. This
prevents an admin to lower the ttl prior to a migration, as the TTL
minimum in the SOA is only used when the opt_ttl field is empty and no
$TTL field has previously been set. 

>From 'man named':
------------------------------------------------------------------------
   Master File Format
     The master file consists of control information and a list of
resource
     records for objects in the zone of the forms:

           $INCLUDE <filename> <opt_domain>
           $ORIGIN <domain>
           $TTL <ttl>
           <domain> <opt_ttl> <opt_class> <type> <resource_record_data>

     where:
<snip />
ttl           A integer number that sets the default time-to-live for
                   future records without an explicit ttl.

opt_ttl       An optional integer number for the time-to-live field.  If
              not set the ttl is taken from the last $TTL statement.  If
              no $TTL statement has occurred then the SOA minimum value
              is used and a warning is generated.
------------------------------------------------------------------------

dnszone.schema has:

------------------------------------------------------------------------
objectclass ( 1.3.6.1.4.1.2428.20.3 NAME 'dNSZone'
        SUP top STRUCTURAL
        MUST ( zoneName $ relativeDomainName )
        MAY ( DNSTTL $ DNSClass $
              ARecord $ MDRecord $ MXRecord $ NSRecord $
              SOARecord $ CNAMERecord $ PTRRecord $ HINFORecord $
              MINFORecord $ TXTRecord $ SIGRecord $ KEYRecord $
              AAAARecord $ LOCRecord $ NXTRecord $ SRVRecord $
              NAPTRRecord $ KXRecord $ CERTRecord $ A6Record $
              DNAMERecord ) )
------------------------------------------------------------------------

The DNSTTL meant to hold the 'opt_ttl' value mentioned in 'man named'.

Based on this information I have created a suggested patch that will add
'$TTL <the soa minimum value>' to the top of the zonefile. The records
themselves will try to read the DNSTTL value from the ldaprecord, and if
not present, write '\t' for the TTL value. effictively that omits the
opt_ttl value (but the '\t' will keep the file lined out and pleasing to
the eye), and the $TTL value from the top of the file is taken. As it is
now, the DNSTTL value will never be found in LDAP of course, simply
because there is no code to put it there. Probably something that should
be added sometime, as bind9-ldap will be looking for that attribute too.

enjoy,

-- 
Envida                     http://www.envida.net/
Armand A. Verstappen       Vleutenseweg 86
[email protected]       3532 HM  Utrecht
tel: +31 (0)30 299 2109    The Netherlands
fax: +31 (0)30 299 2108
ispman-1.2.dnsttl.diff.bz2 (application/x-bzip, 1.2 KB) - not displayed
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.