# \#challenge:dns-server

**URL:** https://forum.codecrafters.io/tag/challenge-dns-server/6.md

[Latest](https://forum.codecrafters.io/latest.md) · [Categories](https://forum.codecrafters.io/categories.md) · [Tags](https://forum.codecrafters.io/tags.md)

---

## [PHP track now supports DNS server](https://forum.codecrafters.io/t/php-track-now-supports-dns-server/16071)

<div class="topic-metadata">

**Author:** [@andy1li](https://forum.codecrafters.io/u/andy1li)\
**Replies:** 0\
**Last updated:** [April 28, 2026, 12:38am UTC](https://forum.codecrafters.io/t/php-track-now-supports-dns-server/16071 "2026-04-28T00:38:20Z")

</div>

Hey everyone! The PHP track now includes the Build your own DNS server challenge. Ready to put your PHP skills to the test? Jump into the PHP track, and let us know how it goes!

---

## [Spotted a copy-paste typo in the dns-server-tester go.mod](https://forum.codecrafters.io/t/spotted-a-copy-paste-typo-in-the-dns-server-tester-go-mod/16056)

<div class="topic-metadata">

**Author:** [@dhotrey](https://forum.codecrafters.io/u/dhotrey)\
**Replies:** 1\
**Last updated:** [April 22, 2026, 3:32am UTC](https://forum.codecrafters.io/t/spotted-a-copy-paste-typo-in-the-dns-server-tester-go-mod/16056 "2026-04-22T03:32:14Z")

</div>

Hey team, I was reading the source code for the DNS tester and noticed a naming collision. It looks like a bit of copy-paste debt from the grep challenge, the go.mod for the DNS tester is currently identifying itself …

---

## [Elixir track now supports DNS server](https://forum.codecrafters.io/t/elixir-track-now-supports-dns-server/15864)

<div class="topic-metadata">

**Author:** [@andy1li](https://forum.codecrafters.io/u/andy1li)\
**Replies:** 0\
**Last updated:** [February 1, 2026, 10:58pm UTC](https://forum.codecrafters.io/t/elixir-track-now-supports-dns-server/15864 "2026-02-01T22:58:33Z")

</div>

Hey everyone! The Elixir track now includes the Build your own DNS server challenge. Ready to put your Elixir skills to the test? Jump into the Elixir track, and let us know how it goes!

---

## [\[DNS Server\] #YC9 Overflowing header size](https://forum.codecrafters.io/t/dns-server-yc9-overflowing-header-size/15621)

<div class="topic-metadata">

**Author:** [@natalka1122](https://forum.codecrafters.io/u/natalka1122)\
**Replies:** 2\
**Last updated:** [December 4, 2025, 7:42pm UTC](https://forum.codecrafters.io/t/dns-server-yc9-overflowing-header-size/15621 "2025-12-04T19:42:35Z")

</div>

I’m stuck on Stage #YC9. My DNS server handles compression in incoming packets correctly, and my outgoing responses are uncompressed. The tester is failing with: \[tester::#YC9\] DNS query failed: dns: overflowing header…

---

## [\[DNS Server\] stage 7 (#YC9) passed but the response is malformed](https://forum.codecrafters.io/t/dns-server-stage-7-yc9-passed-but-the-response-is-malformed/15017)

<div class="topic-metadata">

**Author:** [@mabhi256](https://forum.codecrafters.io/u/mabhi256)\
**Replies:** 2\
**Last updated:** [December 4, 2025, 1:09pm UTC](https://forum.codecrafters.io/t/dns-server-stage-7-yc9-passed-but-the-response-is-malformed/15017 "2025-12-04T13:09:44Z")

</div>

My code passed #YC9 even if the answer section doesn’t contain proper response package main import ( "bytes" "encoding/binary" "fmt" "net" ) /\* \* 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 \* |QR| Opcode…

---

## [I passed parsing compressed DNS without actually implementing it](https://forum.codecrafters.io/t/i-passed-parsing-compressed-dns-without-actually-implementing-it/4146)

<div class="topic-metadata">

**Author:** [@sjsakib](https://forum.codecrafters.io/u/sjsakib)\
**Replies:** 4\
**Last updated:** [December 4, 2025, 1:09pm UTC](https://forum.codecrafters.io/t/i-passed-parsing-compressed-dns-without-actually-implementing-it/4146 "2025-12-04T13:09:31Z")

</div>

So I passed parsing compressed DNS without actually implementing it. I tried many ways to send compressed DNS packets to my server. But nothing seems to work. My best try was this script. from scapy.all import \* from sc…

---

## [Strange test #YC9, C++](https://forum.codecrafters.io/t/strange-test-yc9-c/4408)

<div class="topic-metadata">

**Author:** [@Germenzi](https://forum.codecrafters.io/u/Germenzi)\
**Replies:** 2\
**Last updated:** [December 4, 2025, 1:09pm UTC](https://forum.codecrafters.io/t/strange-test-yc9-c/4408 "2025-12-04T13:09:14Z")

</div>

I’m stuck(???) on Stage #YC9. There is a very strange thing I found for me. Some days ago, I successfully passed test #YC9 about parsing compressed packets in DNS server challenge. Today, I started doing next stage, #GT…

---

## [\[DNS SERVER\] Stage 5 (#BF2) "Write question section"](https://forum.codecrafters.io/t/dns-server-stage-5-bf2-write-question-section/15551)

<div class="topic-metadata">

**Author:** [@h3r0cybersec](https://forum.codecrafters.io/u/h3r0cybersec)\
**Replies:** 2\
**Last updated:** [November 20, 2025, 10:40am UTC](https://forum.codecrafters.io/t/dns-server-stage-5-bf2-write-question-section/15551 "2025-11-20T10:40:38Z")

</div>

I’m stuck on Stage (#BF2), where trying to send the DNS response. Below the output of the packet, which fails the “Type” field check in the “Question” section: \[tester::#BF2\] Querying \`A\` record for codecrafters.io. \[y…

---

## [Possible test fault (C++)](https://forum.codecrafters.io/t/possible-test-fault-c/15310)

<div class="topic-metadata">

**Author:** [@Mayhem93](https://forum.codecrafters.io/u/Mayhem93)\
**Replies:** 2\
**Last updated:** [September 18, 2025, 10:43pm UTC](https://forum.codecrafters.io/t/possible-test-fault-c/15310 "2025-09-18T22:43:48Z")

</div>

I’m stuck on Stage #hd8 (actually I’m not stuck, details follow). I’ve tried … adding a lot of debug info to my server and running codecrafters tests 3 times. Here are my logs: remote: \[tester::#HD8\] Connecting to 127…

---

## [\[DNS Server\] #GT1 - Previous stage tries to forward?](https://forum.codecrafters.io/t/dns-server-gt1-previous-stage-tries-to-forward/15261)

<div class="topic-metadata">

**Author:** [@Suibeom](https://forum.codecrafters.io/u/Suibeom)\
**Replies:** 3\
**Last updated:** [September 8, 2025, 3:39pm UTC](https://forum.codecrafters.io/t/dns-server-gt1-previous-stage-tries-to-forward/15261 "2025-09-08T15:39:17Z")

</div>

It looks like Stage #YC9 is trying to forward responses. My server passes YC9 if I ignore the forwarding flags, and passes GT1, but YC9 is forwarding to a server that can’t pass YC9 \[tester::#YC9\] Running tests for Stag…

---

## [\[DNS Server\] Problems for passing the first stage with linux](https://forum.codecrafters.io/t/dns-server-problems-for-passing-the-first-stage-with-linux/14105)

<div class="topic-metadata">

**Author:** [@ExperimentalFish](https://forum.codecrafters.io/u/ExperimentalFish)\
**Replies:** 1\
**Last updated:** [August 9, 2025, 3:16am UTC](https://forum.codecrafters.io/t/dns-server-problems-for-passing-the-first-stage-with-linux/14105 "2025-08-09T03:16:56Z")

</div>

(topic deleted by author)

---

## [Last set of tests appears to be incorrect](https://forum.codecrafters.io/t/last-set-of-tests-appears-to-be-incorrect/11580)

<div class="topic-metadata">

**Author:** [@asteurer](https://forum.codecrafters.io/u/asteurer)\
**Replies:** 4\
**Last updated:** [June 3, 2025, 6:01pm UTC](https://forum.codecrafters.io/t/last-set-of-tests-appears-to-be-incorrect/11580 "2025-06-03T18:01:56Z")

</div>

I recently finished the Golang DNS challenge, and was finishing up a rewrite in Rust; however, my code kept failing at the end, even though the tests I wrote matched what I did in the Go challenge. When I test my code wi…

---

## [Expected answer section to have 2 entries got 1 on last stage](https://forum.codecrafters.io/t/expected-answer-section-to-have-2-entries-got-1-on-last-stage/11277)

<div class="topic-metadata">

**Author:** [@ronak1293](https://forum.codecrafters.io/u/ronak1293)\
**Replies:** 5\
**Last updated:** [May 29, 2025, 6:36pm UTC](https://forum.codecrafters.io/t/expected-answer-section-to-have-2-entries-got-1-on-last-stage/11277 "2025-05-29T18:36:18Z")

</div>

\#include \<iostream\> #include \<cstring\> #include \<sys/socket.h\> #include \<netinet/in.h\> #include \<unistd.h\> #include \<string\> #include \<cerrno\> #include \<arpa/inet.h\> #include\<vector\> std::string forward\_address; std:…

---

## [\#GT1 Error receiving data: Label length exceeds buffer size](https://forum.codecrafters.io/t/gt1-error-receiving-data-label-length-exceeds-buffer-size/10972)

<div class="topic-metadata">

**Author:** [@ptrhcpang](https://forum.codecrafters.io/u/ptrhcpang)\
**Replies:** 4\
**Last updated:** [May 24, 2025, 2:27pm UTC](https://forum.codecrafters.io/t/gt1-error-receiving-data-label-length-exceeds-buffer-size/10972 "2025-05-24T14:27:38Z")

</div>

I’m stuck on Stage #GT1 A number of “stuck on #GT1” posts have mentioned that functions for previous steps stop working. I seem to be having a like problem (but more severe) in that the line: buf, source = …

---

## [\[DNS Server\] your\_program.sh not running](https://forum.codecrafters.io/t/dns-server-your-program-sh-not-running/9552)

<div class="topic-metadata">

**Author:** [@davidginono](https://forum.codecrafters.io/u/davidginono)\
**Replies:** 1\
**Last updated:** [April 28, 2025, 11:44am UTC](https://forum.codecrafters.io/t/dns-server-your-program-sh-not-running/9552 "2025-04-28T11:44:53Z")

</div>

Checklist: :white\_check\_mark: or :cross\_mark:: I’ve uncommented the code. :white\_check\_mark: or :cross\_mark:: I’ve saved the changes. :white\_check\_mark: or :cross\_mark:: I’ve run the git commands: git commit -am "\[see…

---

## [\[DNS Server\] How to pass the first stage?](https://forum.codecrafters.io/t/dns-server-how-to-pass-the-first-stage/4913)

<div class="topic-metadata">

**Author:** [@Sonudhukia143](https://forum.codecrafters.io/u/Sonudhukia143)\
**Replies:** 1\
**Last updated:** [April 23, 2025, 8:15am UTC](https://forum.codecrafters.io/t/dns-server-how-to-pass-the-first-stage/4913 "2025-04-23T08:15:19Z")

</div>

Checklist: :white\_check\_mark: or :x:: I’ve uncommented the code. :white\_check\_mark: or :x:: I’ve saved the changes. :white\_check\_mark: or :x:: I’ve run the git commands: git commit -am "\[seeking help on forum\]" git pu…

---

## [DNS query failed: dns: overflow unpacking uint32](https://forum.codecrafters.io/t/dns-query-failed-dns-overflow-unpacking-uint32/8433)

<div class="topic-metadata">

**Author:** [@danieleasteggiante](https://forum.codecrafters.io/u/danieleasteggiante)\
**Replies:** 3\
**Last updated:** [April 11, 2025, 7:38am UTC](https://forum.codecrafters.io/t/dns-query-failed-dns-overflow-unpacking-uint32/8433 "2025-04-11T07:38:14Z")

</div>

The serialization seems to be god, but I got this error, could you help me?

---

## [Stuck on #GT1 - forwarded queries timeout](https://forum.codecrafters.io/t/stuck-on-gt1-forwarded-queries-timeout/7604)

<div class="topic-metadata">

**Author:** [@0xi4o](https://forum.codecrafters.io/u/0xi4o)\
**Replies:** 2\
**Last updated:** [March 27, 2025, 1:23am UTC](https://forum.codecrafters.io/t/stuck-on-gt1-forwarded-queries-timeout/7604 "2025-03-27T01:23:56Z")

</div>

I’m stuck on Stage #GT1. The queries that I forward to the custom resolver are timing out and I’m not getting a response. I’m not sure what I’m doing wrong. Here are my logs: \[tester::#GT1\] Running tests for Stage #GT…

---

## [How to get \`dig\` to send multiple questions at once?](https://forum.codecrafters.io/t/how-to-get-dig-to-send-multiple-questions-at-once/5087)

<div class="topic-metadata">

**Author:** [@merc1er](https://forum.codecrafters.io/u/merc1er)\
**Replies:** 6\
**Last updated:** [March 24, 2025, 11:16am UTC](https://forum.codecrafters.io/t/how-to-get-dig-to-send-multiple-questions-at-once/5087 "2025-03-24T11:16:23Z")

</div>

How can we test yc9 with dig (or similar tools)? It looks like dig only sends questions one by one, but this step requires handling multiple questions within the same query.

---

## [Rust 2024 Edition (1.85)](https://forum.codecrafters.io/t/rust-2024-edition-1-85/6502)

<div class="topic-metadata">

**Author:** [@smackysnacks](https://forum.codecrafters.io/u/smackysnacks)\
**Replies:** 3\
**Last updated:** [March 13, 2025, 6:51pm UTC](https://forum.codecrafters.io/t/rust-2024-edition-1-85/6502 "2025-03-13T18:51:40Z")

</div>

The Rust 2024 edition was stabilized last month. I would really like to use it while building a DNS server (and other projects).

---

## [DNS Server | Rust | dns: buffer size too small](https://forum.codecrafters.io/t/dns-server-rust-dns-buffer-size-too-small/6370)

<div class="topic-metadata">

**Author:** [@roman-barman](https://forum.codecrafters.io/u/roman-barman)\
**Replies:** 2\
**Last updated:** [March 11, 2025, 8:19am UTC](https://forum.codecrafters.io/t/dns-server-rust-dns-buffer-size-too-small/6370 "2025-03-11T08:19:09Z")

</div>

In the “Write question section” task tests have logs: remote: \[tester::#BF2\] Running tests for Stage #BF2 (Write question section) remote: \[tester::#BF2\] Starting DNS server on 127.0.0.1:2053 remote: \[tester::#BF2\] Runn…

---

## [Last Step of the challenge - timeout with multiple queries](https://forum.codecrafters.io/t/last-step-of-the-challenge-timeout-with-multiple-queries/6399)

<div class="topic-metadata">

**Author:** [@baristaGeek](https://forum.codecrafters.io/u/baristaGeek)\
**Replies:** 2\
**Last updated:** [March 10, 2025, 11:34pm UTC](https://forum.codecrafters.io/t/last-step-of-the-challenge-timeout-with-multiple-queries/6399 "2025-03-10T23:34:35Z")

</div>

Dealing with multiple queries has been very challening for me. I haven’t been able to make it work with tthe following timeout error I get on #YC9 (after #GT1 passes the test) remote: \[tester::#YC9\] Running tests for St…

---

## [I am quite stuck on #GT1](https://forum.codecrafters.io/t/i-am-quite-stuck-on-gt1/6194)

<div class="topic-metadata">

**Author:** [@routineyfans](https://forum.codecrafters.io/u/routineyfans)\
**Replies:** 2\
**Last updated:** [March 9, 2025, 3:52pm UTC](https://forum.codecrafters.io/t/i-am-quite-stuck-on-gt1/6194 "2025-03-09T15:52:17Z")

</div>

What i didn’t understand is, Every dns message coming from client is now forwarded? the dns message coming from the dns-resolver(where we forwared) is only answer(?) that we should include directly while sending respon…

---

## [Stuck on GT1 When Using custom resolver](https://forum.codecrafters.io/t/stuck-on-gt1-when-using-custom-resolver/5667)

<div class="topic-metadata">

**Author:** [@DeshErBojhaa](https://forum.codecrafters.io/u/DeshErBojhaa)\
**Replies:** 1\
**Last updated:** [February 28, 2025, 6:33am UTC](https://forum.codecrafters.io/t/stuck-on-gt1-when-using-custom-resolver/5667 "2025-02-28T06:33:00Z")

</div>

I’m stuck on Stage #gt1 When I use custom resolver, it cant find the IP address. Here are my logs: \[tester::#YC9\] Running tests for Stage #YC9 (Parse compressed packet) \[tester::#YC9\] Starting DNS server on 127.0.0.1:…

---

## [Final challenge: forwarding server, doubt regarding the resolver](https://forum.codecrafters.io/t/final-challenge-forwarding-server-doubt-regarding-the-resolver/4841)

<div class="topic-metadata">

**Author:** [@tarun-verma](https://forum.codecrafters.io/u/tarun-verma)\
**Replies:** 1\
**Last updated:** [February 13, 2025, 1:56am UTC](https://forum.codecrafters.io/t/final-challenge-forwarding-server-doubt-regarding-the-resolver/4841 "2025-02-13T01:56:24Z")

</div>

I’m not sure I fully understand what’s being asked here. Do we run our own resolver on the specified IP and port received via the command line argument? Because when I tried to do so, I got “address already in use” error…

---

## [\#YC9 DNS query failed: dns: bad rdata (SOLVED)](https://forum.codecrafters.io/t/yc9-dns-query-failed-dns-bad-rdata-solved/4556)

<div class="topic-metadata">

**Author:** [@kibin](https://forum.codecrafters.io/u/kibin)\
**Replies:** 1\
**Last updated:** [January 30, 2025, 11:08pm UTC](https://forum.codecrafters.io/t/yc9-dns-query-failed-dns-bad-rdata-solved/4556 "2025-01-30T23:08:12Z")

</div>

hey, how do you test it locally? I’m stuck with bad data, but all previous tests are passing. Either I miss something in spec, or I have some stupid mistake the data I’m getting: b’\\x1e\\xae\\x01\\x00\\x00\\x02\\x00\\x00\\x00…

---

## [Git push does not start a test](https://forum.codecrafters.io/t/git-push-does-not-start-a-test/4391)

<div class="topic-metadata">

**Author:** [@aditya-chaple](https://forum.codecrafters.io/u/aditya-chaple)\
**Replies:** 1\
**Last updated:** [January 22, 2025, 2:32pm UTC](https://forum.codecrafters.io/t/git-push-does-not-start-a-test/4391 "2025-01-22T14:32:43Z")

</div>

I completed 2 stages of the DNS server challenge in one day and proceeded to continue another day. I opened up the project, wrote the code and tried pushing the changes through git. The push succeeded but the test doesn’…

---

## [Forwarding Server #gt1 - Running the full test suite](https://forum.codecrafters.io/t/forwarding-server-gt1-running-the-full-test-suite/4232)

<div class="topic-metadata">

**Author:** [@ivanbgd](https://forum.codecrafters.io/u/ivanbgd)\
**Replies:** 4\
**Last updated:** [January 18, 2025, 12:20pm UTC](https://forum.codecrafters.io/t/forwarding-server-gt1-running-the-full-test-suite/4232 "2025-01-18T12:20:00Z")

</div>

How is this last stage different in terms of running our code versus the previous stages? In previous stages we didn’t have to pass any command line arguments to our program. In this stage we have to, but then the prev…

---

## [Stuck on #gt1 DNS for multiple questions](https://forum.codecrafters.io/t/stuck-on-gt1-dns-for-multiple-questions/3300)

<div class="topic-metadata">

**Author:** [@hpca01](https://forum.codecrafters.io/u/hpca01)\
**Replies:** 4\
**Last updated:** [December 15, 2024, 2:31pm UTC](https://forum.codecrafters.io/t/stuck-on-gt1-dns-for-multiple-questions/3300 "2024-12-15T14:31:22Z")

</div>

I’m stuck on Stage #(change to your stage, ex. #GT1). The 1:1 questions and answers work just fine, but for sending a query for 2 questions separately is causing an io timeout Here are my logs: \[your\_program\] There ar…

---

## [\#YC9 dns: bad rdata](https://forum.codecrafters.io/t/yc9-dns-bad-rdata/3402)

<div class="topic-metadata">

**Author:** [@ankur12345678](https://forum.codecrafters.io/u/ankur12345678)\
**Replies:** 2\
**Last updated:** [December 15, 2024, 2:15pm UTC](https://forum.codecrafters.io/t/yc9-dns-bad-rdata/3402 "2024-12-15T14:15:47Z")

</div>

I have gone through all the tickets with same issue but i wasn’t able to find any help with those so i am creating a new topic. Here what i am doing is parsing the email from dns request and generate a response in forma…

[Next page](https://forum.codecrafters.io/tag/challenge-dns-server/6.md?match_all_tags=true&page=1&tags%5B%5D=challenge%3Adns-server)
