Is it possible to enable EDNS and set the query ID at the same time? #1170
-
Hi all, I'm enabling EDNS when sending the query: resolver = dns.resolver.Resolver()
resolver.nameservers = [dns_server]
resolver.port = dns_port
edns_option = dns.edns.GenericOption(EDNS0_TEST_TAG, test_id.bytes)
resolver.use_edns(edns=True, options=[edns_option]) This works as expected. However I'd also like to manually set the query ID. I noticed I can do it when crafting the query: query = dns.message.make_query("dns.google", dns.rdatatype.A)
query.id = query_id
answer = dns.query.udp(query, dns_server, port=dns_port) But it looks like that the resolver that I have above doesn't accept a crafted query. Is there a way to set both? Thank you |
Beta Was this translation helpful? Give feedback.
Answered by
ns-sjorgedeaguiar
Dec 17, 2024
Replies: 1 comment
-
Oh found out I can do this: query = dns.message.make_query("dns.google", dns.rdatatype.A)
query.id = query_id
query.use_edns(
edns=True,
ednsflags=0,
payload=4096,
options=[edns_option]
)
response = dns.query.udp(query, dns_server, port=dns_port) This fits my needs |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
ns-sjorgedeaguiar
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Oh found out I can do this:
This fits my needs