Coding Challenge 44 - Build Your Own DNS Forwarder

Coding Challenge 44 - Build Your Own DNS Forwarder

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:

  1. I write another FREE newsletter?Developing Skills?that helps you level up the other skills you need to be a great software developer.
  2. I have some courses available: Become a Better Software Developer by Building Your Own Redis Server (Python Edition) which guides you through solving the Redis Coding Challenge in Python. Build Your Own Shell (Go Edition) which guides you through solving the Shell Coding Challenge in Go.

Eric M.

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!

Eric Roby

Software Engineer | Python Enthusiast | AI Nerd | Good Person to Know

1 年

Awesome mini product!

Alexandros Mioglou

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..

Ahmed Hagi

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.

Marc van Neerven

Fractional CTO & Mentor ?? Top Startups Voice? Helping startups make better SaaS - #hiring for World of Wow!

1 年

Whoa, that's low-level!

要查看或添加评论,请登录

John Crickett的更多文章

  • Coding Challenge #86 - Strace

    Coding Challenge #86 - Strace

    This challenge is to build your own version of Linux tool strace. It’s a useful tool to debug programs that you don’t…

    9 条评论
  • From The Challenges - Memcached Server

    From The Challenges - Memcached Server

    ?? ?? Happy Birthday Coding Challenges - Two Years Old! ?? ?? Coding Challenges is turning two this week! To celebrate…

    13 条评论
  • Coding Challenge #85 - Time Zone Converter

    Coding Challenge #85 - Time Zone Converter

    Coding Challenge #85 - Time Zone Converter This challenge is to build your own Time Zone Converter. That is a tool to…

    12 条评论
  • From The Challenges - IRC Client

    From The Challenges - IRC Client

    Welcome To Coding Challenges - From The Challenges! In this Coding Challenges “from the challenges” newsletter I’m…

    5 条评论
  • Coding Challenge #84 - Mandelbrot Set Explorer

    Coding Challenge #84 - Mandelbrot Set Explorer

    This challenge is to build your own Mandelbrot set explorer. The Mandelbrot set is a set of fractals that exhibit great…

    4 条评论
  • From The Challenges - Cat

    From The Challenges - Cat

    Welcome To Coding Challenges - From The Challenges! In this Coding Challenges “from the challenges” newsletter I’m…

    7 条评论
  • Coding Challenge #83 - Markdown Presentation Tool

    Coding Challenge #83 - Markdown Presentation Tool

    Coding Challenge #83 - Markdown Presentation Tool This challenge is to build your own version of Go’s Present or…

    3 条评论
  • From The Challenges - Shell

    From The Challenges - Shell

    Welcome To Coding Challenges - From The Challenges! In this Coding Challenges “from the challenges” newsletter I’m…

    3 条评论
  • Coding Challenge #82 - Markdown To PDF Editor

    Coding Challenge #82 - Markdown To PDF Editor

    Coding Challenge #82 - Markdown To PDF Editor This challenge is to build your own tool to convert markdown to PDF. It…

    14 条评论
  • From The Challenges - Diff

    From The Challenges - Diff

    Welcome To Coding Challenges - From The Challenges! In this Coding Challenges “from the challenges” newsletter I’m…

    7 条评论

社区洞察

其他会员也浏览了