NAME

Zonemaster::Config - configuration access module for Zonemaster

SYNOPSIS

my $value = Zonemaster::Config->get->{key}{subkey};

METHODS

get()

Returns a reference to a hash with configuration values. As of this writing, this is simply seeded from static values hardcoded into the module. This is intended to change.

policy()

Returns a reference to the current policy data. The format of that data is yet to be decided on.

load_policy_file($filename)

Load policy information from the given file and merge it into the pre-loaded policy. Information from the loaded file overrides the pre-loaded information when the same keys exist in both places.

load_config_file($filename)

Load configuration information from the given file and merge it into the pre-loaded config. Information from the loaded file overrides the pre-loaded information when the same keys exist in both places.

CONFIGURATION DATA

The configuration data is stored internally in a nested hash (possibly with arrays as values in places). As of this writing, the file format used is JSON.

The interesting keys are as follows.

resolver

defaults

These are the default flag and timing values used for the resolver objects used to actually send DNS queries.

usevc

If set, only use TCP. Default not set.

retrans

The number of seconds between retries. Default 3.

dnssec

If set, sets the DO flag in queries. Default not set.

recurse

If set, sets the RD flag in queries. Default not set (and almost certainly should remain that way).

retry

The number of times a query is sent before we give up. Can be set to zero, although that's not very useful (since no queries will be sent at all). Defaults to 2.

igntc

If set, queries that get truncated UDP responses will be automatically retried over TCP. Default not set.

net

ipv4

If set, resolver objects are allowed to send queries over IPv4. Default set.

ipv6

If set, resolver objects are allowed to send queries over IPv6. Default set.

no_network

If set to a true value, network traffic is forbidden. Use when you want to be sure that any data is only taken from a preloaded cache.

logfilter

By using this key, the log level of messages can be set in a much more fine-grained way than by the policy file. The intended use is to remove known erroneous results. If you, for example, know that a certain name server is recursive and for some reason should be, you can use this functionality to lower the severity of the complaint about it to a lower level than normal.

The the data under the logfilter key should be structured like this:

Module
   Tag
      "when"
         Hash with conditions
      "set"
         Level to set if all conditions match

The hash with conditions should have keys matching the attributes of the log entry that's being filtered (check the translation files to see what they are). The values for the keys should be either a single value that the attribute should be, or an array of values any one of which the attribute should be.

A complete entry might could look like this:

"SYSTEM": {
    "FILTER_THIS": {
        "when": {
            "count": 1,
            "type": ["this", "or"]
        },
        "set": "INFO"
    }
}

This would set the level to INFO for any SYSTEM:FILTER_THIS messages that had a count attribute set to 1 and a type attribute set to either this or or.