domain
domain copied to clipboard
Change `qr` bit
The DNS packet header bit QR
is set to 0
for queries and 1
for a response.
domain::base::header::Header
casts this to a bool
where 0
becomes false
and 1
becomes true
.
This is incredibly confusing to me since qr
is clearly meant to mean query
, so when you use the qr()
method you basically have to to the opposite of what the header field indicates.
While I agree this is technically correct (as it just describes wether the flag is set) this took me about 1hr and largely re-implementing a dns parser from scratch to figure out. Soooo maybe we should do something about that 😄