Utilities
*********

MyDNS includes several helpful utilities.

All utilities support the --host, --database, --user, and --password options.

mydnscheck
==========

The mydnscheck program scans one more more zones and reports on syntax and consistency problems in the zone data.  When used without any zone arguments, mydnscheck checks all zones by default.

mydnscheck outputs lines of tab-delimited data.  This is so that it will hopefully be easier for experienced users to write scripts to automate fixups, in the event that they have created a new database that has many problems. Each line contains seven fields:

 1. A brief, human-readable string describing the error found.

 2. The zone ID, or - if no zone ID is applicable.

 3. The resource record ID, or - if no resource record ID is applicable.

 4. The name, or - if no name is applicable.

 5. The ttl (time-to-live) value, or - if no ttl is applicable.

 6. The resource record type, or - if no type is applicable.

 7. The data value, or - if no data value is applicable.

The most useful way for an administrator to use mydnscheck is without any arguments (indicating a scan of all zones) and with the database consistency check option enabled.  This will perform a thorough analysis of your database.  To perform this type of check, you would run:

     # mydnscheck --consistency

You can also run mydnscheck on a single zone only.  This might be useful if invoked from a CGI script, to offer customers or clients the ability to check their zone:

     $ mydnscheck -uUSER -pPASS example.com

For an explanation of all available options, please see the mydnscheck(8) man page.

mydnsexport
===========

The mydnsexport program outputs zone data in various formats understood by DNS servers other than MyDNS.

By default, mydnsexport exports a single zone specified on the command line in BIND format.  The following command would output the example.com zone in BIND zone file format:

     # mydnsexport example.com

mydnsexport can also output tinydns-data style data files, as used by the tinydns name server, by specifying the -t, --tinydns-data option.  If this output format is specified, and no zone names are provided on the command line, mydnsexport will output all zones.

For an explanation of all available options, please see the mydnsexport(8) man page.

mydnsimport
===========

The mydnsimport program can be used to import data into your MyDNS database from external sources.  This is the simplest way to seed your database when migrating from another name server to MyDNS.

The only import option supported at this time is the -a, --axfr option.  Pretty much every name server on the market supports DNS-based zone transfers via AXFR.  Make sure your MyDNS server has permission to request a zone transfer for the zone you wish to import, then specify the host name and zone name with the --axfr option.

If you want to test permissions, you can use the dig command, like:

     # dig @bind.example.com axfr example.com

Let's say you have a BIND server located at bind.example.com and you are going to get rid of it and switch to MyDNS.  Great!  You want to import the zones example.com and example.net, as well as the PTR records from 1.168.192.in-addr.arpa.  You would issue the following commands:

     # mydnsimport --axfr=bind.example.com example.com example.net
     # mydnsimport --axfr=bind.example.com 1.168.192.in-addr.arpa

For an explanation of all available options, please see the mydnsimport(8) man page.