Week 7: Lines, Lines, and More Lines

Maleea m -

 

Again, my fight with my virtual machine persists, this time with an update lasting around 2 hours. 🙁

Despite my struggles with an invisible robot that lives inside a more physical one, I am building my DNS in Python with the help of CodeCrafters!

 

Step 1: Reading the Incoming Messages (UDP Packets)

First, I had to figure out how to read the messages that computers send when they ask, “Hey, where’s this website?” These messages use something called the UDP protocol, and they come in as raw data—a bunch of ones and zeros.

Imagine someone handing you a super long string of numbers and expecting you to know it means “maleeaisawesome.com.” That’s what my server had to do: take in that mess of data, break it apart, and figure out what website the person was asking for.

It’s like learning a secret code that websites use to talk to each other.

Step 2: Playing Pretend

Once my server could understand those messages, the next step was answering back.

At this stage, it only knew how to give one answer, no matter what you asked. Like if someone asked, “Where’s maleeaisawesome.com?” my server would always say, “That’s at 1.2.3.4,” even though that’s not the real address.

This helped me learn how to send a response that other computers could understand. The hardest part? Making sure the answer was built exactly the way other systems expect it. If it’s even a little off, it doesn’t work.

Step 3: Forwarding to Another Server

Of course, my server needed to do more than just fake it. So the next step was teaching it to ask a real DNS server (like Google’s 8.8.8.8) for help when it didn’t know the answer.

So now, when someone asks my DNS server, “Where’s maleeaisawesome.com?” it goes, “I’ll go find out,” asks a real DNS server, grabs the real answer, and then hands it back.

This week consisted of 200+ lines of code and A LOT of help. The largest obstacle I faced through this building process was truly understanding what I was writing. After countless YouTube videos, Reddit feeds, and ChatGPT answers, I am unable to deeply understand every piece that makes up my DNS server. I am excited for college and the chance to dive into how all these pieces fit together and how they truly work.

 

Next week, I will figure out how to deploy my code and use it for more than just giving me errors and hours of headaches.

 

dfoginwr9tigh

“Fun” Frightening Fact of the Week:

Prolonged time spent debugging programs can lead to harmful thoughts and lots of tears. (A friend told me this one)

 

(I’m that friend)

More Posts

Comments:

All viewpoints are welcome but profane, threatening, disrespectful, or harassing comments will not be tolerated and are subject to moderation up to, and including, full deletion.

    samantha_g
    The way you described the difference between faking an answer and forwarding to a real server helped me understand the DNS process a lot better. Once your DNS server is fully deployed, do you have any ideas for security features you’d like to add—like filtering domains, logging traffic, or blocking trackers?
    mae_b
    Wow! So will your DNS be able to automatically screen for fishy things going on with your devices?

Leave a Reply

Your email address will not be published. Required fields are marked *