Last set of tests appears to be incorrect

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 with dig, it works perfectly. Based on my logs, it looks like the final question def.longassdomainname.com has a pointer, but is missing the null termination byte after the pointer (see below). Let me know if you need more information.

# HEADER

00000110

10011001

00000001

00000000

00000000

00000010

00000000

00000000

00000000

00000000

00000000

00000000

# QUESTION: abc.longassdomainname.com

00000011

01100001

01100010

01100011

00010001

01101100

01101111

01101110

01100111

01100001

01110011

01110011

01100100

01101111

01101101

01100001

01101001

01101110

01101110

01100001

01101101

01100101

00000011

01100011

01101111

01101101

00000000

00000000, 00000001

00000000, 00000001

# QUESTION: def.longassdomainname.com

00000011

01100100

01100101

01100110

11000000, 00010000 // POINTER

// MISSING NULL TERMINATION BYTE

00000000, 00000001

00000000, 00000001

Hey @asteurer, a pointer doesn’t need a null termination byte. The section it points to already includes one.

Let me know if you’d like further clarification!

Oh, did I misunderstand the message compression documentation? Based on the figure in section 4.1.4 in RFC 1035, it looks like they have multiple null termination bytes:

Oh, the RFC does explain that the last null byte represents the root domain (.):

Got it. Thanks for this Andy!

1 Like