Skip to content
Discussion options

You must be logged in to vote

message.to_wire(want_shuffle=False) will turn off shuffling, but that may not be enough because dnspython will still be assembling RRsets from the wire. If some pathological code emitted RRs in an RRset interleaved with RRs from another RRset, the order would still change, e.g.

target.example A 10.0.0.1
query.example CNAME target.example
target.example A 10.0.0.2

would become

target.example A 10.0.0.1
target.example A 10.0.0.2
query.example CNAME target.example

The way to ensure that there is NO reordering of RRs is to pass one_rr_per_rrset=True when parsing the message. This puts every RR into an RRset of one rdata.

Replies: 5 comments 4 replies

Comment options

You must be logged in to vote
0 replies
Answer selected by rthalley
Comment options

You must be logged in to vote
2 replies
@rthalley
Comment options

@jschlyter
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@bwelling
Comment options

bwelling Dec 3, 2025
Collaborator

@bwelling
Comment options

bwelling Dec 3, 2025
Collaborator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants