Skip to content

mathe-matician/dns_forwarder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Purpose

This comes from John Crickett's DNS Forwarder coding challenge

Known TODOs

  • I never finished the serialize() function and don't intend to. So the forwarder forwards the request, and parses the reply, but doesn't serialize it as the reply to the client. So the reply buffer dig receives is the untouched reply.
  • I never finished reformatting a cached result to be returned to the dns tool and don't intend to. So if you hit a cached result your dns tool will hang until timeout as no result will ever be returned currently.

My reasoning for not finishing these things is mostly because I feel like I learned enough from going through most of the code challenge.

Building

Prereqs

  1. Install boost
brew install boost
  1. Update .vscode/c_cpp_properties.json's includePath to the version of boost that was installed

Steps

  1. Run make
make
  1. Run the binary
./main
  1. Query www.google.com or hopefully somewhere else
dig @127.0.0.1 -p 1053 www.google.com
  1. View logs of server, see that the reply was deserialized.

Takeaways / Learned

  • Using boost for the first time
  • Although probably could have been implemented a different way, I got to play with bitsets, which I've never used before.
  • Using wireshark for debugging packets and octect offsets
  • Introduction to DNS protocol
  • Generally more experience translating RFCs to code
  • Generally more experience with c++

About

dns forwarder coding challenge

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published