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.
Hi @merc1er, dig
doesn’t support sending multiple questions in a single query.
You might want to try kdig or write a custom script to test this locally.
Let me know if you’d like further assistance! We can figure it out together.
Thank you for the response. I actually installed the codecrafters CLI and I run the tests this way without having to push to git every time.
Looks like kdig also sends questions individually. I wasn’t able to get it to send multiple at once.
EDIT: I am also reading online that multiple “questions” in the same query is practically not supported: domain name system - Multi-query multiple DNS record types at once - Server Fault
@merc1er, from what I follow, there is an RFC 9619 that updates the DNS RFC 1035.
From the abstract:
This document updates RFC 1035 by constraining the allowed value of the QDCOUNT parameter in DNS messages with OPCODE = 0 (QUERY) to a maximum of one, and it specifies the required behavior when values that are not allowed are encountered.
@merc1er You’re absolutely right! kdig
sends questions individually. Apologies for the confusion!
You can try this python script to send multiple questions in a single request:
from scapy.all import DNS, DNSQR, IP, UDP, sr1
query = (
IP(dst="127.0.0.1")
/ UDP(dport=2053)
/ DNS(rd=1, qd=[DNSQR(qname="example.com"), DNSQR(qname="codecrafters.io")])
)
response = sr1(query)
print(response[DNS].an)
Closing this thread due to inactivity. If you still need assistance, feel free to reopen or start a new discussion!
This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.