erldns_zones (erldns v10.0.0-rc4)

View Source

The system responsible for loading and caching zone data.

Zones are loaded by default from JSON files in the priv/zones/ directory. The path is configured in erldns.config using the zones.path setting.

For more details about zone file format and configuration, see ZONES.

For more details about its subsections, see:

Configuration

{erldns, [
    {zones, #{
        path => "zones.json",
        keys_path => "/root/dnssec/",
        strict => true,
        format => auto,
        timeout => timer:minutes(5),
        codecs => [sample_custom_zone_codec],
        context_options => #{match_empty => true, allow => [<<"anycast">>, <<"AMS">>, <<"TKO">>]}
    }},
]}

See the type config/0 for details.

Summary

Types

Zone configuration.

Types

config()

-type config() ::
          #{path => undefined | file:name(),
            keys_path => undefined | file:name(),
            strict => boolean(),
            format => format(),
            timeout => timeout(),
            codecs => [module()],
            context_options => #{match_empty => boolean(), allow => [binary()]}}.

Zone configuration.

  • path: can be a file or a directory:

    • If it is a file, format will be ignored
    • If it is a directory, it will find all nested files matching the format specified in format
  • strict: declares whether any loading error should crash the whole loading process or be ignored.

  • keys_path: specifies the path to DNSSEC keys used for signing and validating zones. These file should be named after the zone name with the .private file extension (i.e.: "example.com.private") and should contain a JSON formatted list of keysets as in the JSON zone format documentation.

  • format: specifies the zone file format to look for. Both formats support custom codecs for handling unknown record types. Valid values are:

    • json: zones are parsed using erldns's JSON zone format.
    • zonefile: zones are parsed using the zone format.
    • auto: both filetypes will be loaded depending on their file extension.
  • timeout: specify how long zone loading can take before being aborted. Defaults to 30 minutes.

  • codecs: a list of modules that implement the erldns_zone_codec behaviour.

  • context_options: allow you to filter loading certain records in a zone depending on configuration details. See ZONES for more details.

See erldns_zone_loader for more details.

format()

-type format() :: json | zonefile | auto.

version()

-type version() :: binary().