Lethean Name Server — DNS for .lthn from ITNS sidechain
Find a file
Claude f917d3e994
test(lns): add unit tests for discovery and DNS resolution
28 tests covering:
- parseAliasComment: Good/Bad/Ugly (v=lthn1 parsing, edge cases)
- splitSemicolon: delimiter splitting
- indexOf: character search
- parseLTHNName: .lthn zone parsing, apex, rejection
- arpaToIP: reverse DNS conversion
- splitDot: IP octet splitting

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 05:09:27 +01:00
cmd/lns test(lns): add unit tests for discovery and DNS resolution 2026-04-02 05:09: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