Go binary serving .lthn DNS from ITNS sidechain. - DNS over UDP+TCP (A, AAAA, TXT, NS, SOA, PTR) - Chain-based discovery via get_all_alias_details - Tree-root invalidation (getblockchaininfo) - hns= alias comment override - Health endpoint (/health) - 672 lines, core/go@v0.8.0-alpha.1 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1.6 KiB
1.6 KiB
LNS — Lethean Name Server
Serves .lthn DNS from the ITNS sidechain. Light mode — queries remote HSD RPC, discovers names from the main chain, serves DNS over UDP+TCP.
Built with dappco.re/go/core@v0.8.0-alpha.1.
Quick Start
# Docker (light mode — no chain sync needed)
docker compose up -d
# Or native
GOWORK=off go build -o lns ./cmd/lns
DAEMON_URL=http://127.0.0.1:46941 HSD_URL=http://127.0.0.1:14037 ./lns
Test
# DNS (UDP + TCP)
dig @localhost charon.lthn A
dig @localhost charon.lthn TXT
dig @localhost charon.lthn A +tcp
# HTTP API
curl http://localhost:5553/resolve?name=charon
curl http://localhost:5553/names
curl http://localhost:5553/health
Configuration
| Env var | Default | Description |
|---|---|---|
LNS_MODE |
light | light (remote HSD) |
DAEMON_URL |
http://127.0.0.1:46941 | Main chain RPC (for alias discovery) |
HSD_URL |
http://127.0.0.1:14037 | HSD sidechain RPC |
HSD_API_KEY |
testkey | HSD API key |
| `DNS_PORT | 53 | DNS server port (UDP + TCP) |
HTTP_PORT |
5553 | HTTP API port |
CHECK_INTERVAL |
15 | Tree root check seconds |
Discovery
On startup, LNS queries the main chain (get_all_alias_details) for registered aliases. Each alias becomes an HNS name to resolve on the sidechain. If an alias comment has hns=X.lthn, the HNS name is X (not the alias name). Falls back to a hardcoded list if the chain is unreachable.
Architecture
See code/core/go/blockchain/RFC.lns.md for the full spec (16 sections).
Main chain (aliases) → Discovery → HSD sidechain (records) → Cache → DNS + HTTP