dns: pick the extra_records_path format by file extension

HuJSON and YAML records work too; an unknown extension fails instead of being
parsed as JSON.
This commit is contained in:
Kristoffer Dalby
2026-09-28 13:33:22 +00:00
committed by Kristoffer Dalby
parent dd8ce695cf
commit 906016beb4
4 changed files with 12 additions and 9 deletions
+1 -1
View File
@@ -67,7 +67,7 @@ hostname and port combination "http://hostname-in-magic-dns.myvpn.example.com:30
!!! tip "Good to know"
- The `dns.extra_records_path` option in the [configuration file](configuration.md) needs to reference the
JSON file containing extra DNS records.
file containing extra DNS records. Its extension picks the format: `.json`, `.hujson`, `.yaml` or `.yml`.
- Be sure to "sort keys" and produce a stable output in case you generate the JSON file with a script.
Headscale uses a checksum to detect changes to the file and a stable output avoids unnecessary processing.