Configuration¶
This page shows where Ninlil reads its settings from, how to change one and how to turn on an extra transport.
Where settings come from¶
Ninlil reads its settings from three sources. A later source overrides an earlier one:
appsettings.jsonin the content root. The content root is the folder Ninlil starts in. The Linux packages and the container image set it to the data directory.NINLIL_*environment variables.- Command-line arguments, such as
--Storage:MigrationSafety:RestoreSnapshot=<id>.
Three more facts:
- The admin console's settings pages write your changes to
appsettings.jsonand show a note that says whether the change applies at once or after a restart. - Ninlil reads environment variables once, at start. Restart Ninlil after you change one. A value set by an environment variable overrides the same value saved on a page.
- You can load another settings file. Set
NINLIL_DNS_SERVER_RUNTIME_SETTINGS_CONFIGURATION_FILE_PATHto its path. Ninlil loads and watches it likeappsettings.json. It ranks aboveappsettings.{Environment}.jsonand below the environment variables. The path itself comes from an environment variable or fromappsettings.json, never from that file.
Before you start¶
Ninlil is installed. The examples use a binary named ./ninlil-linux-amd64 and unprivileged ports.
Start it from the same folder each time, so it finds the same data/ folder.
Change a setting with an environment variable¶
- Find the setting's row in the environment variables.
- Build the variable name. Take the setting's configuration path, for example
DnsServer:Web:HttpPort. Split every segment into its PascalCase words, uppercase them, join them with_and prefixNINLIL_. The result isNINLIL_DNS_SERVER_WEB_HTTP_PORT.IPv4andIPv6each count as one word. TheSection__Keyform does nothing here, and a list-valued setting has no variable. -
Set the variable in the environment of the Ninlil process and start Ninlil:
NINLIL_DNS_SERVER_WEB_HTTP_PORT=18080 \ NINLIL_DNS_SERVER_WEB_HTTPS_PORT=18443 \ NINLIL_DNS_SERVER_PROTOCOL_PLAIN_PORT=15300 \ ./ninlil-linux-amd64Where the variable goes depends on how Ninlil runs:
/etc/ninlil/ninlil.envfor the Deb and RPM packages,-efor Docker, the service'sEnvironmentvalue on Windows.
Check that it worked¶
The log lists the ports Ninlil listens on:
Now listening on: http://[::]:18080
Now listening on: https://[::]:18443
A command-line argument beats an environment variable. Starting the same command with
--DnsServer:Web:HttpPort=18081 listens on http://[::]:18081.
Settings most installations change¶
| Variable | Controls | Default |
|---|---|---|
NINLIL_STORAGE_ENGINE |
Storage backend: Sqlite, PostgreSql, MySql, SqlServer, MongoDb |
Sqlite |
NINLIL_STORAGE_CONNECTION_STRING |
Connection string for the selected engine | none (SQLite creates a local file) |
NINLIL_DNS_SERVER_WEB_HTTP_PORT and NINLIL_DNS_SERVER_WEB_HTTPS_PORT |
The REST API and admin console ports | 80 and 443 |
NINLIL_DNS_SERVER_PROTOCOL_PLAIN_PORT |
The plain DNS port | 53 |
NINLIL_IDENTITY_BOOTSTRAP_ADMINISTRATOR_PASSWORD |
The bootstrap administrator's password | random, printed once |
NINLIL_DNS_SERVER_RECURSIVE_ENABLE_RECURSION |
Whether the server answers recursive queries | false |
NINLIL_DHCP_SERVER_PROTOCOL_DHCPV4_ENABLE and NINLIL_DHCP_SERVER_PROTOCOL_DHCPV6_ENABLE |
Whether the DHCPv4 and DHCPv6 engines run | false |
The environment variables page lists the rest.
Turn on an extra transport¶
Every DNS transport beyond plain DNS, and both DHCP protocols, are off until you turn them on with
their own Enable setting. The admin console's Presets & Settings page applies a curated
bundle instead. To turn on DNS-over-TLS, use either form.
With an environment variable:
NINLIL_DNS_SERVER_PROTOCOL_DNS_OVER_TLS_ENABLE=true ./ninlil-linux-amd64
Or in appsettings.json:
{
"DnsServer": {
"Protocol": {
"DnsOverTls": { "Enable": true }
}
}
}
Check it: with the default port, ss -ltn 'sport = :853' lists a listener. The
ports table lists the default port of every transport, and the
Encrypted transports guide covers each transport.
Next¶
- Environment variables
- Ports
- Docker, for setting variables in a container