Why Building a DNS Server in Gleam Is a Genius Move
Why Building a DNS Server in Gleam Is a Genius Move
Let's be honest: most developers treat DNS as magic. You type a domain name, and somehow, the right server responds. Behind that magic sits infrastructure that's often decades old, written in C or Go, and maintained by small teams carrying tremendous responsibility.
Enter Armadillo, a DNS server written in Gleam by developer vshakitskiy. And honestly? This is one of the most interesting projects to cross our radar in a while.
Why Gleam Makes Sense Here
Gleam is a functional programming language that compiles to both Erlang and JavaScript. It's built on the BEAM virtual machine—the same battle-tested runtime powering Erlang and Elixir. This gives Gleam programs access to:
- Lightweight processes for handling concurrent connections
- Fault tolerance with automatic process recovery
- Hot code reloading capabilities
- Battle-tested runtime that's been running telecom infrastructure since the 1980s
For a DNS server, these aren't just nice-to-have features—they're essential. DNS servers need to handle thousands of simultaneous queries, recover gracefully from failures, and stay operational even when things go wrong. The BEAM VM was literally designed for this.
What Makes Armadillo Interesting
The project implements a complete DNS server from scratch. That means handling:
- DNS packet parsing and serialization
- Query type handling (A, AAAA, CNAME, MX, and more)
- Caching logic for improved performance
- Zone file management
The code is written in Gleam's signature style: expressive, type-safe, and remarkably readable. If you've ever tried to parse DNS packets in C or even Go, you know this is no small feat. Gleam's type system catches entire categories of bugs at compile time—critical when you're writing security-critical infrastructure code.
The Developer Experience Angle
Here's what gets us excited: Gleam's tooling is chef's kiss. The standard library is elegant, error messages are helpful, and the compiler is fast. Writing DNS infrastructure in this environment means developers can focus on the logic rather than wrestling with memory management or fighting borrow checker errors.
For startups and developers building custom DNS infrastructure, this opens up possibilities that weren't previously accessible without learning Erlang or Elixir.
Getting Involved
The project is open source on GitHub, and contributions are welcome. Whether you're interested in adding support for new record types, improving performance, or writing documentation, there's room to make an impact.
You can check out the repository at github.com/vshakitskiy/armadillo and start exploring the codebase today.
The Bigger Picture
Projects like Armadillo represent a broader trend: developers are getting more intentional about how they build infrastructure. The era of defaulting to the same old languages for everything is giving way to choosing the right tool for the domain.
DNS is too important to be left to legacy codebases alone. If you're a developer interested in networking, compilers, or functional programming, this is a fantastic project to sink your teeth into.
What will you build on the BEAM?
Curious about DNS and infrastructure? At NameOcean, we help developers and startups navigate the world of domains, DNS management, and hosting. Explore our solutions at NameOcean.