NicTool 2.10 release

Started by matt, November 22, 2011, 01:07:57 AM

Previous topic - Next topic

matt

The changes are numerous and extensive. See the change log for details.

http://www.nictool.com/download/NicToolServer.shtml

matt

#1
New Features


  • Completely new export scripts. They are much easier to set up, they only export when necessary (only if a zone has been altered since the last export), additional support for more record types is included, adding support for new types in the future is way easier (making it more likely to happen), and the code is far easier to alter and maintain.
  • Added support for export to BIND
  • added IPv6 address expansion (from djbdnsRecordBuilder)
  • SPF record support (in addition to TXT SPF records)
  • SQL: added sql/upgrade.pl. It logs into a NicTool database, determines which SQL updates are required, and runs them.
  • added location support to database and tinydns exports.
  • added support for exporting nsid=0 (all nameservers). Exports every zone, regardless of NS preference.  Useful for virtual nameservers with the tinydns multiip patch.

Improved Features:

  • added label validation of domain names
  • added RFC 2181 domain name length restrictions
  • made bin/nt_install_deps.pl more reliable
  • added RFC 2181 tests. CNAME records cannot coexist with any other record type (except DNSSEC). NS and MX must not point to a CNAME.
  • SQL: export_serials controls export of serial nums for tinydns export. This is a database flag for the name server now, instead of a export process command line option.
  • SQL: Fixed the data model for zone nameservers. Replaced the abhorrent nt_zone.ns0..ns9 columns with the table nt_zone_nameservers.
  • do not replace : chars in record addresses. No longer necessary because export routines handle encoding of : during export.
  • SQL: added nt_zone_record.timestamp field. See the timestamp description on the tinydns-data page. Allows start/stop times for records.


Other Changes:

  • SQL: added resource_record_types table.
  • ripped out SSL certificate management (great idea, but unused)
  • removed all summary code (unused)
  • ripped out nt_nameserver.service_type (unused)
  • removed the quotes from many integers.
  • SQL: converted deleted database fields from enum to tinyint(1) because enums are evil.
  • SQL: renamed nt_zone.output_format to export_format
  • ripped out all the https support from NicTool (server, client, API)
  • added addserver and zone2nic in api/contrib (from Adrian)
  • SQL: renamed nt_nameserver.export_format='djb' -> 'tinydns'
  • SQL: added record types to database: DS, DNSKEY, KEY (not used yet)



matt

A bug has been discovered in NicTool 2.10 and 2.11.  When zones are exported, the zone records from deleted zones are also exported. The fix is here:

https://github.com/msimerson/NicTool/commit/502463d8fada8d8c8da24ecec3a0a8cb0d89a9fc


diff --git a/server/lib/NicToolServer/Export.pm b/server/lib/NicToolServer/Export.pm
index e15a835..fe535a2 100644
--- a/server/lib/NicToolServer/Export.pm
+++ b/server/lib/NicToolServer/Export.pm
@@ -408,14 +408,13 @@ sub get_ns_records {
       FROM nt_zone_record r
         LEFT JOIN resource_record_type t ON t.id=r.type_id
         LEFT JOIN nt_zone_nameserver ns ON ns.nt_zone_id=r.nt_zone_id
-        JOIN nt_zone z ON ns.nt_zone_id=z.nt_zone_id";
+        JOIN nt_zone z ON ns.nt_zone_id=z.nt_zone_id
+      WHERE z.deleted=0
+        AND r.deleted=0";

     my @args;
-    if ( $self->{ns_id} == 0 ) {
-        $sql .= " WHERE r.deleted=0";  # all zone recs
-    }
-    else {
-        $sql .= " WHERE ns.nt_nameserver_id=? AND r.deleted=0";
+    if ( $self->{ns_id} != 0 ) {
+        $sql .= " AND ns.nt_nameserver_id=?";
         push @args, $self->{ns_id};
     }