Coding Challenge 44 - Build Your Own DNS Forwarder
John Crickett
Helping you become a better software engineer by building real-world applications.
This challenge is to build your own DNS Forwarder.
I’d Like You Input!
I’ve had some requests for Coding Challenges to provide automates tests for each step of the challenges and some form of leaderboard. In short to build something a bit like CodeCrafters.
Is that something you’d like to see, or should I focus on the courses? Please comment below or message me with your thoughts.
A DNS Forwarder is a nameserver used to resolve DNS queries instead of directly using the authoritative nameserver chain. Often they are used to sit on the edge of a local area network and provide DNS resolution to the computers on the network, reducing external traffic and speeding up external access by serving the answer from a local cache.
The Challenge - Building A DNS Forwarder
In this challenge we’re going build a simple DNS Forwarder that can resolve the IP address for a host either from it’s local cache, or by forwarding the request to an authoritative nameserver.
Step Zero
In this introductory step you’re going to set your development environment up ready to begin developing and testing your solution.
I’ll leave you to choose your target platform, setup your editor and programming language of choice. I’d encourage you to pick a tech stack that you’re comfortable doing network programming with - we’re going to be creating, sending and receiving UDP packets.
领英推荐
Step 1
In this step your goal is to create a UDP server that will listen on a specified port for incoming requests. Your server should use port 53 if no port is provided, otherwise it should use the provided port (i.e. add a command line option to specify it). Note for testing we’ll use a port above 1023 as many OSs don’t allow non-privileged users to use a port below 1023.
Once you have your server running you can test it with dig. That might look like this:
% dig @127.0.0.1 -p 1053 www.google.com
With the server so far running in another terminal.
% ccdns
MSG received
All the server does so far is listen for messages, so I’m just printing out the fact that something was received. We’ll handle it in a later step.
Continued...
You can find Step 2 and beyond on the Coding Challenges website as build your ownDNS Forwarder.
Or if you'd rather get the whole challenge delivered to you inbox every week, you can subscribe on the Coding Challenges Substack.
2 Other Ways I Can Help You:
Data Scientist | Software Engineer | Educator & Tutor | Founder of Career Code Pro – Empowering Future Tech Innovators
1 年This allows people to build a heck of a compelling portfolio. Thank you for coming up with these ideas!
Software Engineer | Python Enthusiast | AI Nerd | Good Person to Know
1 年Awesome mini product!
DevOps Engineer at Netcompany-Intrasoft | AWS?Azure?Terraform Certified
1 年Reminded me of this repo: https://github.com/codecrafters-io/build-your-own-x Also, that I should find some time to try these out..
Software Engineer
1 年I believe the current approach is more effective than introducing automated tests and a leaderboard. Existing platforms already offer plenty of those features. What sets your methods apart is their emphasis on in-depth analysis, which I find more beneficial. Implementing automated tests and leaderboards might lead to a decline in quality. Moreover, the absence of these elements actually encourages continuous, organic test development.
Fractional CTO & Mentor ?? Top Startups Voice? Helping startups make better SaaS - #hiring for World of Wow!
1 年Whoa, that's low-level!