← Back to projects/LazyFlare
Systems · networking · Built

LazyFlare

A small DNS server in Rust that answers from plain zone files.

  • Rust
  • DNS
  • Zone files
  • A / CNAME
Sample terminal output of a DNS lookup

Overview

LazyFlare is a small authoritative DNS server. Point it at a folder of zone files and it answers queries for A and CNAME records with well-formed DNS responses.

Zone files in, answers out

An illustrative zone file and query (the real format is in the repository).

zone file

; github.com
www   CNAME github.com.
@     A     20.205.243.166
api   A     20.205.243.168

query and answer

$ dig www.github.com
www.github.com.  CNAME  github.com.
github.com.      A      20.205.243.166

Try the resolver

A toy zone, resolved in your browser. It mimics the behaviour; it is not the Rust server.

www.github.com CNAME github.com. A 20.205.243.166

How a query flows

Resolution

QueryUDP packet
ParseDNS message
Zone lookupA / CNAME
Encoderesponse

Key features

A records

Name to IPv4 address.

CNAME records

Alias one name to another.

Zone files

Plain text, one folder.

Written in Rust

Systems-level, no runtime.

Technical stack

  • Rust
  • DNS
  • Zone files
  • A / CNAME
Terminal output
FIG. 1Terminal output. A lookup answered from a zone file (illustrative).
Query path
FIG. 2Query path. Client to resolver to LazyFlare to zone files (illustrative).

Resolution

QueryUDP packet
ParseDNS message
Zone lookupA / CNAME
Encoderesponse
FIG. 3Resolution steps. Parse, look up, encode.
← PreviousChatlyNext →NepSyc