Requests with NSID?

39 views
Skip to first unread message

Paul Hoffman

unread,
Oct 11, 2021, 3:04:15 PM10/11/21
to dnspython-users
Greetings again.
   q = dns.message.make_query(dns.name.from_text("."), dns.rdatatype.SOA, use_edns=0, options=[dns.edns.OptionType.NSID])
Returns
   option is not a dns.edns.option
And yet it seems like it is... Clues appreciated.

--Paul Hoffman

Bob Halley

unread,
Oct 11, 2021, 3:32:08 PM10/11/21
to dnspython-users
It needs to be a dns.edns.Option subclass, not the integer option value.  (Options are like rdata in that there's a registry of classes, and while the GenericOption is useful for most things we also have the ECSOption which is useful for the complicated EDNS Client Subnet option.)

q = dns.message.make_query(dns.name.from_text("."), dns.rdatatype.SOA, use_edns=0, options=[dns.edns.GenericOption(dns.edns.OptionType.NSID, b'')])
Reply all
Reply to author
Forward
0 new messages