Commits

Łukasz Langa committed 913a532

document customizable resource record types

Comments (0)

Files changed (2)

 Simply add ``powerdns`` to ``INSTALLED_APPS`` in your ``settings.py``. Use
 South for database migrations.
 
+Customizing resource record types
+---------------------------------
+
+If you're not using DNSSEC or the other less common record types, you can
+simplify the user interface even more by specifying a sequence of types the app
+should use. Simply put this in your ``settings.py``::
+
+  POWERDNS_RECORD_TYPES = (
+      'A', 'AAAA', 'CNAME', 'HINFO', 'MX', 'NAPTR', 'NS',
+      'PTR', 'SOA', 'SRV', 'TXT',
+  )
+
+Consult PowerDNS documentation for a `list of supported resource record types
+<http://doc.powerdns.com/types.html>`_.
+
 Using a separate database for PowerDNS
 --------------------------------------
 

powerdns/models.py

 from django.utils.translation import ugettext_lazy as _
 
 
-RECORD_TYPES = (
-    'A', 'AAAA', 'CERT', 'CNAME', 'DNSKEY', 'DS', 'HINFO', 'KEY', 'LOC', 'MX',
-    'NAPTR', 'NS', 'NSEC', 'PTR', 'RP', 'RRSIG', 'SOA', 'SPF', 'SSHFP', 'SRV',
+BASIC_RECORD_TYPES = (
+    'A', 'AAAA', 'CNAME', 'HINFO', 'MX', 'NAPTR', 'NS', 'PTR', 'SOA', 'SRV',
     'TXT',
 )
 
+DNSSEC_RECORD_TYPES = ('DNSKEY', 'DS', 'KEY', 'NSEC', 'RRSIG')
+
+AUX_RECORD_TYPES = ('AFSDB', 'CERT', 'LOC', 'RP', 'SPF', 'SSHFP')
+
+RECORD_TYPES = sorted(set(
+    BASIC_RECORD_TYPES + DNSSEC_RECORD_TYPES + AUX_RECORD_TYPES
+))
+
 try:
     RECORD_TYPES = settings.POWERDNS_RECORD_TYPES
 except AttributeError: