erldns_zones (erldns v10.0.0-rc4)
View SourceThe 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
-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,
formatwill be ignored - If it is a directory, it will find all nested files matching the format specified in
format
- If it is a file,
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.privatefile extension (i.e.: "example.com.private") and should contain a JSON formatted list of keysets as in theJSONzone format documentation.format: specifies the zone file format to look for. Both formats support custom codecs for handling unknown record types. Valid values are:timeout: specify how long zone loading can take before being aborted. Defaults to 30 minutes.codecs: a list of modules that implement theerldns_zone_codecbehaviour.context_options: allow you to filter loading certain records in a zone depending on configuration details. SeeZONESfor more details.
See erldns_zone_loader for more details.
-type format() :: json | zonefile | auto.
-type version() :: binary().