Hey everyone. It’s Sherub here, author of the Build your own DNS Server challenge on CodeCrafters. Currently it’s available in Rust, Go, and Python and is free while in beta.
https://codecrafters.io/dns-server
I’ve kept the challenge accessible but still challenging for an intermediate developer. This challenge, like others from CodeCrafters, is self-paced. You can use any tools you prefer (terminal, editor, etc.) to build the project.
At the end of the challenge, you will have created a DNS forwarding server. The server can create and read DNS packets and respond to DNS queries. As you go, you’ll learn about the DNS protocol, its format, servers, and A records. All while getting to hone your language skills.
Some of the challenges and choices I had to make:
-
To make the stages easier, I had to break them up, such that each step builds on the previous one. This was especially challenging for the 2nd stage, where we write a DNS packet’s header contents. Even though I’d have liked it to be easier, breaking it up further would have been weird.
-
Instead of implementing a recursive resolver, I’ve restricted to a forwarding server. We made this decision so that most developers can still use it. To add more complexity, we can use a challenge extension (noted below).
-
Deciding how much instruction and context the stages should provide. I’ve decided to keep them as thorough as possible for most of the stages. Developers can choose to have thorough details or just skim through them.
I would love your feedback and questions on the challenge. You can try it out for free here: https://codecrafters.io/dns-server (no CC required).
I also have challenge extensions planned. You can find them at https://app.codecrafters.io/vote/challenge-extension-ideas?c…. I’m also keen to hear what you think about the extension ideas.
There is a discussion on Hacker News, but feel free to comment here as well.
Nice! I wanted to this for quite a while but always stopped when I didn’t find pragmatic material about DNS. This course should help a lot with knowing where to start.