How is encoded the URL

I read here that the request is base64URL encode. But if I make a pyhton script, or use a web site to encode “” I get a tottaly different result :




What I’m missing?
Thanks for the help

It is not just the that is base64 encoded, it is the entire DNS message.

This includes the DNS message header, as well as the question section which contains

Taking the example of q80BAAABAAAAAAAAA3d3dwdleGFtcGxlA2NvbQAAAQAB:

>>> import dns.message
>>> packet = 'q80BAAABAAAAAAAAA3d3dwdleGFtcGxlA2NvbQAAAQAB'.decode('base64')
>>> msg = dns.message.from_wire(packet)
>>> print msg
id 43981
opcode QUERY
flags RD

I understand now what contains the base64, but is there a way to generate automatically a request? Or should I copy/paste and encode all the fields (from a wireshark request).?

You do realize that it is also possible to get a JSON response and make the query with a simple GET URL, right?

Yeah, I already made a script in Python testing if DoH is running on the server by using Json, but I wanted to try with Wireformat too

This topic was automatically closed after 14 days. New replies are no longer allowed.