cdnsd

January 1, 2026 ยท View on GitHub

Resolver for Cardano-based second-level domains on Handshake top-level domains

Features

  • Blockchain-based DNS indexer and resolver:
    • Supports Cardano and Handshake network integration
    • Dynamic top-level domain (TLD) discovery and management
    • ICANN root hints for non-blockchain domain resolution
  • Multi-protocol DNS service:
    • Standard DNS over UDP and TCP
    • DNS over TLS (when enabled)
  • Real-time monitoring:
    • Prometheus metrics endpoint
    • Optional request-level query logging
  • Pluggable configuration:
    • YAML file and environment variable support
    • Profile-based settings for network/TLDs
  • Debugging and Observability:
    • Optional debug HTTP server (for pprof, etc.)
  • Persistence:
    • Local disk database to store sync state and discovered blockchain data

Configuration

cdnsd supports configuration via YAML config files, and all settings may be overridden with environment variables.

Top-level Config Options (YAML)

OptionTypeEnvironment VariableDescription
logging.debugboolLOGGING_DEBUGEnable debug logging (default: false)
logging.queryLogboolLOGGING_QUERY_LOGEnable DNS query logging (default: true)
metrics.addressstringMETRICS_LISTEN_ADDRESSIP/interface for Prometheus metrics listener
metrics.portuintMETRICS_LISTEN_PORTTCP port for Prometheus metrics
dns.addressstringDNS_LISTEN_ADDRESSDNS listener IP/interface (empty = all)
dns.portuintDNS_LISTEN_PORTDNS UDP/TCP port (default: 8053)
dns.tlsPortuintDNS_LISTEN_TLS_PORTDNS-over-TLS port (default: 8853)
dns.recursionEnabledboolDNS_RECURSIONAllow recursive DNS lookups
dns.rootHintsstringDNS_ROOT_HINTSDNS root hints (PEM string)
dns.rootHintsFilestringDNS_ROOT_HINTS_FILEFile path to DNS root hints
debug.addressstringDEBUG_ADDRESSAddress for debug HTTP server (default: localhost)
debug.portuintDEBUG_PORTPort for debug HTTP server
indexer.networkstringINDEXER_NETWORKCardano network name (e.g. preprod, mainnet)
indexer.networkMagicuint32INDEXER_NETWORK_MAGICCardano network magic value
indexer.addressstringINDEXER_TCP_ADDRESSCardano node TCP address
indexer.socketPathstringINDEXER_SOCKET_PATHPath to Cardano node IPC socket
indexer.interceptHashstringINDEXER_INTERCEPT_HASHInitial sync block hash for chain
indexer.interceptSlotuint64INDEXER_INTERCEPT_SLOTInitial sync slot number
indexer.verifyboolINDEXER_VERIFYEnable indexer verification mode
indexer.handshakeAddressstringINDEXER_HANDSHAKE_ADDRESSHandshake peer address to connect
state.dirstringSTATE_DIRDirectory for persistent state (BadgerDB)
tls.certFilePathstringTLS_CERT_FILE_PATHPath to TLS certificate for DNS over TLS
tls.keyFilePathstringTLS_KEY_FILE_PATHPath to TLS key for DNS over TLS
profiles[]stringPROFILESList of enabled network profiles

Example YAML Snippet

logging:
  debug: true
  queryLog: true
metrics:
  address: ""
  port: 9000
dns:
  address: "0.0.0.0"
  port: 8053
  tlsPort: 8853
  recursionEnabled: false
  rootHintsFile: "/etc/cdnsd/named.root"
debug:
  address: "127.0.0.1"
  port: 6060
indexer:
  network: "preprod"
  networkMagic: 1
  address: "preprod-node.local:3001"
  socketPath: ""
  interceptHash: ""
  interceptSlot: 0
  verify: false
  handshakeAddress: ""
state:
  dir: "/var/lib/cdnsd"
tls:
  certFilePath: "/etc/cdnsd/cert.pem"
  keyFilePath: "/etc/cdnsd/key.pem"
profiles:
  - "cardano-preprod-testing"

Profiles

Profiles predefine settings for specific TLDs and Cardano/Handshake networks. Enable profiles via the profiles YAML array or PROFILES environment variable.

Example profiles:

  • cardano-preprod-testing
  • ada-preprod
  • hydra-preprod

See the profile config file for the full list and details.

Running

Start cdnsd with:

cdnsd -config /etc/cdnsd/config.yaml

Or, override settings with environment variables, e.g.:

export DNS_LISTEN_PORT=5353
cdnsd

Metrics & Observability

  • Prometheus: Exposed at /metrics (port per config)
  • Debug HTTP/pprof: If debug port is set, accessible for diagnostics