Show HN: I built a DNS resolver from scratch in Rust – no DNS libraries (github.com)

by rdme 68 comments 115 points
Read article View on HN

68 comments

[−] rdme 43d ago
Since I needed it to be my primary DNS, I also added: recursive resolution from root nameservers, DNSSEC chain-of-trust validation, ad blocking (385K+ domains), and LAN service discovery.

I wrote about the DNSSEC implementation here: https://numa.rs/blog/posts/dnssec-from-scratch.html It's now my daily system DNS. Single binary (~8MB), macOS/Linux/Windows.

sudo numa install

[−] pyprism 43d ago
Very interesting project! I have a couple of questions. With all the default blocked domains loaded, what is the average memory usage? Currently, I am using Pi-hole on a low memory single board computer. Is it possible to use this instead of Pi-hole? If so, I’d like to use it for all of my devices."
[−] rdme 43d ago
With 390K blocked domains: ~31MB total process footprint. Breakdown: - Blocklist: 23.4MB (390K domains) - Cache: 3.8MB (4.4K entries) - Query log, SRTT, runtime: ~4MB

It binds to 0.0.0.0:53 by default, so just point your devices' DNS to the board's IP

[−] onel 42d ago
Romanian project. Instant upvote. Great work
[−] rdme 43d ago
Thanks! If you hit any issues during setup, feel free to open an issue — happy to help debug. The dashboard at localhost:5380 shows what's happening in real time.
[−] siruwastaken 43d ago
Why are you replying to your own coment?
[−] happytoexplain 43d ago
I think it's a bot? There's an identical version of this comment in another reply, except it cuts off half way through a sentence.
[−] rdme 43d ago
I hit reply on the wrong post and you can't delete comments or at least I don't see how it can be done
[−] dgb23 43d ago
Above the comments I've written on HN I see:

5 minutes ago | parent | next | edit | delete

[−] hxugufjfjf 43d ago
That only lasts for a few minutes until it’s locked and you can no longer delete after that.
[−] rdme 43d ago
because I clicked reply on the wrong one and you can't delete it...
[−] nalekberov 43d ago
Of course I can’t prove it, but i am guessing some kind of “AI” is doing that. Humans rarely use emdashes.
[−] voxadam 43d ago
It's neither here nor there but can I ask about the name? I only ask because when I see "numa" in relation to computing I immediately think "Non-Uniform Memory Access".

Very cool project by the way. I wonder how this would run on an OpenWRT device.

I see in your install.sh that you support Linux and Darwin/MacOS, do you think there would be any major hurdles in supporting FreeBSD?

[−] dwedge 43d ago
I have a couple of projects that once a month need to run a few million dns lookups as quickly as possible. I'm tempted to try this just to see how it performs and if it breaks.
[−] kevin061 43d ago
The interface looks vibecoded. I have no problem with people vibecoding things. In fact, I have zero frontend skills, so I rely on AI to be able to make easy-to-use interfaces. However, I feel like this should be clearly and prominently displayed in the project page.

Furthermore it is a little off-putting to see a vibecoded UI because I have very little confidence that the rest of the backend code is not vibecoded. I know I am possibly being unfair, but this is how it looks to me. If the developer tells me they didn't use AI at all, I would believe it.

[−] p2hari 43d ago
Nice idea. To test I ran a simple nextjs on port 3000. Added the service via the dashboard. However, when I visit the url, (using chrome latest version), https://{mygivenname}.numa/ I hit a DNS resolution fail error. If I do not use a trailing '/' then it is going to google search for {mygivenname}.numa and shows me some search results. Should I open an issue?
[−] conradludgate 43d ago
What's the reason you're not using hickory? Or was that the LLMs choice? Genuinely curious
[−] 6r17 43d ago
Same hack here ; I have no DSN running by default - much more handy than having to set up nginx as it has no opinion on the targeted infrastructure. And the bonus point is that you can see every sneaky request that happens when you browse ; so another side-project connected to this is to make an inventory and policy filter
[−] bahador 43d ago
feature request: libnuma so i can use it programmatically with configuration. also, multiple user defined blocklists.
[−] fanf2 42d ago
The first thing I look at in new DNS code is whether it’s vulnerable to DNS name compression loops. This code passes the test! However it’s vulnerable to dots embedded in labels: it doesn’t escape bytes properly when converting from wire format to text.
[−] BugsBunnyCodes 43d ago
I have a project that requires DNS lookups and block ads. I am going to try this for it.
[−] dev_l1x_be 43d ago
How is to compare to AdGuard? If it gets those features I would be switching over.
[−] rbluethl 43d ago
Cool idea, every developer running apps in dev on their machine knows this pain for sure. I'll give it a spin and let you know how it goes!
[−] lyfeninja 43d ago
I think I need to give this a go. Cool project.
[−] Asuka-wx 43d ago
Nice work. What made you choose this license?
[−] _kidlike 43d ago
very interesting. how does the blocklist work? can one manage the lists? like StevenBlack or others.
[−] bulanel 43d ago
nice
[−] voltagex_ 43d ago
Great idea, pity about the slop.
[−] goodpoint 43d ago
we need a [slop] flag in the headlines
[−] derodero24 42d ago
[flagged]
[−] derodero24 42d ago
[flagged]
[−] derodero24 42d ago
[flagged]
[−] arafeq 43d ago
[flagged]
[−] EdoardoIaga 43d ago
[flagged]