Build & run
Quickstart
Requires cosmocc (Cosmopolitan toolchain). The dhall-c interpreter core
is a git submodule at ./dhall-c.
Native — make
git submodule update --init
make
make test
Browser — make wasm
make wasm
node tests/wasm-smoke.js
Needs emscripten clang lld llvm nodejs.
Usage
./dnsd.com --config config.example.dhall --port 5353 --address 127.0.0.1
# options: -c/--config (Dhall config, required) · -p/--port (default 5353) · -a/--address (default 127.0.0.1)
Config format
let Record = < A : { name : Text, ttl : Natural, value : Text }
| AAAA : { name : Text, ttl : Natural, value : Text }
| CNAME : { name : Text, ttl : Natural, value : Text }
| TXT : { name : Text, ttl : Natural, value : Text }
| MX : { name : Text, ttl : Natural, priority : Natural, exchange : Text }
| NS : { name : Text, ttl : Natural, value : Text }
| SOA : { name : Text, ttl : Natural, mname : Text, rname : Text, serial : Natural
, refresh : Natural, retry : Natural, expire : Natural, minimum : Natural }
| CAA : { name : Text, ttl : Natural, flags : Natural, tag : Text, value : Text } >
in let Zone = { name : Text, records : List Record }
in let Config = { zones : List Zone }
in { zones = [ { name = "example.com.", records = [ < A = { name = "@", ttl = 3600, value = "192.0.2.1" } > ] } ] } : Config
Owner names are relative to the zone (@ / "" = apex); rdata target names are absolute FQDNs with a trailing dot. See config.example.dhall for a full example.