[DNS Server] #YC9 Overflowing header size

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 size.
[tester::#YC9] If you are seeing this after a while then it is likely that your server is not responding with appropriate id
[tester::#YC9] Test failed

Here are my packets:
Incoming request

b'o@\x01\x00\x00\x02\x00\x00\x00\x00\x00\x00\x03abc\x11longassdomainname\x03com\x00\x00\x01\x00\x01\x03def\xc0\x10\x00\x01\x00\x01'
DnsDatagram(questions=[Question(qname=b'abc.longassdomainname.com', qtype=<RecordType.A: 1>, qclass=<RecordClass.IN: 1>), Question(qname=b'def.longassdomainname.com', qtype=<RecordType.A: 1>, qclass=<RecordClass.IN: 1>)], resource_records=[], id=28480, qr=0, opcode=0, aa=0, tc=0, rd=1, ra=0, z=0, rcode=0, nscount=0, arcount=0)

Outgoing response

b'o@\x81\x00\x00\x02\x00\x02\x00\x00\x00\x00\x03abc\x11longassdomainname\x03com\x00\x00\x01\x00\x01\x03def\x11longassdomainname\x03com\x00\x00\x01\x00\x01\x03abc\x11longassdomainname\x03com\x00\x00\x01\x00\x01\x00\x00\x00<\x00\x00\x00\x04\x08\x08\x08\x08\x03def\x11longassdomainname\x03com\x00\x00\x01\x00\x01\x00\x00\x00<\x00\x00\x00\x04\x08\x08\x08\x08'
DnsDatagram(questions=[Question(qname=b'abc.longassdomainname.com', qtype=<RecordType.A: 1>, qclass=<RecordClass.IN: 1>), Question(qname=b'def.longassdomainname.com', qtype=<RecordType.A: 1>, qclass=<RecordClass.IN: 1>)], resource_records=[ResourceRecord(rname=b'abc.longassdomainname.com', rtype=<RecordType.A: 1>, rclass=<RecordClass.IN: 1>, rttl=60, rdata='8.8.8.8'), ResourceRecord(rname=b'def.longassdomainname.com', rtype=<RecordType.A: 1>, rclass=<RecordClass.IN: 1>, rttl=60, rdata='8.8.8.8')], id=28480, qr=1, opcode=0, aa=0, tc=0, rd=1, ra=0, z=0, rcode=0, nscount=0, arcount=0)

The transaction ID matches correctly (28480), my flags are set right, I’m echoing back the everything properly. I have no idea what else could be wrong. Does this stage actually require compression in the response?

Hey @natalka1122, the RDLENGTH field should be a 2-byte integer, instead of 4:

Let me know if you’d like any further clarification!

1 Like

Thank you so much! I passed this step.
Although error message is kinda confusing

1 Like

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.