YANG Data Model


YANG Modules

All Modules are located in yang-modules/ project directory.


Data Model

Common Model - cznic-resolver-common

Common Data model configuration options are divided into several sections.

In order to unify Knot and Unbound configuration into the cznic-resolver-common, some configurations are not generated directly from value in the common model, but before generating must be converted to configuration value which is accepted by resolver.

Here is how some values are converted:

server:

There is no group-name option for Unbound to set.

# DataModel:
"server": {
    "user-name": "username",
    "group-name": "group"
}

# KnotResolver:
user('username','group')        # Conversion:  no conversion

# Unbound:
username: "username"            # Conversion:  no conversion

network:

resolver:

stub-zones:

# DataModel:
"stub-zones": [
    {
    "domain": "stub.example.com",
    "nameserver": "192.0.2.1",
    "port": 53                             # Default:  53
    }
]

# KnotResolver:
STUB('192.0.2.1@53')                       # Conversion:  'nameserver' + port -> nameserver@port'

# Unbound:
stub-zone:
   name: "stub.example.com"                # Conversion:   no conversion
   stub-addr: "192.0.2.1@53"               # Conversion:  'nameserver' + port -> nameserver@port'

Knot Resolver STUB(ip) configuration only accepts IP addresses. In common configuration option "nameserver" can be Name or IP address. If "nameserver" option is Name, gethostbyname method from module socket is used to ask for IP address of this Name. For Unbound is used stub-host: configuration function insted of stub-addr:

options:

# DataModel:
"options": {
    "glue-checking": true | false,
}

# KnotResolver:
mode('strict' | 'normal' | 'permissive')    # Conversion:   true -> "strict"
                                                            false -> "normal"

# Unbound:
harden-glue: yes | no                       # Conversion:   no conversion

Knot Resolver has three options of glue-checking, but to simplify the data model, there is conversion to two options like it is in Unbound.

logging

verbosity:

# DataModel:
"logging": {
  "verbosity": 0-5       # Default:  1
}

# KnotResolver:
verbosity: 0-5           # Conversion:   no conversion

# Unbound:
verbose(true | false)    # Conversion:   0 -> false
                         #               1-5 -> true

dnssec:

cache:

dns64: