Lethean Name Server — DNS for .lthn from ITNS sidechain
Find a file
Claude e107d6b3a7
fix(dns): change default DNS port from 5353 to 5354
Port 5353 conflicts with system mDNS (avahi). Port 5354 avoids the
conflict while remaining in the same range. Dockerfile updated to match.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 05:08:27 +01:00
cmd/lns fix(dns): change default DNS port from 5353 to 5354 2026-04-02 05:08:27 +01:00
docker-compose.yml feat(lns): Lethean Name Server v0.1.0 2026-04-01 22:28:46 +01:00
Dockerfile fix(dns): change default DNS port from 5353 to 5354 2026-04-02 05:08:27 +01:00
go.mod feat(lns): Lethean Name Server v0.1.0 2026-04-01 22:28:46 +01:00
go.sum feat(lns): Lethean Name Server v0.1.0 2026-04-01 22:28:46 +01:00
lns feat(lns): Lethean Name Server v0.1.0 2026-04-01 22:28:46 +01:00
README.md feat(lns): Lethean Name Server v0.1.0 2026-04-01 22:28:46 +01:00

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