MaraDNS: Shortcuts in zone files

Previously I have blogged about installing MaraDNS as an authoritative nameserver on CentOS Linux. In this article I am going to look at some convenient shortcut functions that you can use in your MaraDNS zone files.

Zone files for your domain names can contain some easy to use shortcut functions. Here are some of them:

  • TTL Function: Add /ttl to a line in your zone file to define the default Time To Live of subsequent zone records:

    /ttl 14400 ~ A ~ A ~

    In the above example both A records will have a TTL of 14400 or 4 hours.

  • Percentage symbol: The percentage sign can be used to refer to the zone file’s domain name. For example if you are creating a zone file for the domain name and you include this in it:

    % A ~
    www.% A ~

    It is the same as this: A ~ A ~
  • Serial function: The serial function generates a serial number based on the zone file’s last update timestamp. You can use it in your Start Of Authority (SOA) record: SOA /serial 86400 3600 604800 86400 ~

    This function saves you from having to update the serial number each time you make a change in the zone file.

These shortcuts make it more convenient to edit and maintain zone files for your domain names.

Leave a Reply

Your email address will not be published. Required fields are marked *