Record the problems you encountered when using dnspython to update tlsa
1. After filling in the tlsa object and updating the object, print the update object and find that the message is correct. However, after sending the message using TCP, query the newly added record and find that the byte is misplaced, as shown in figure
The record to be added is: _ 443. _ tcp.www.test.com in tlsa 1 2 3 XXXX.
After the record is successfully added, query the record to obtain
_ 443. _ tcp.www.test.com in tlsa 0 1 0 0203 xxxx
It is strange that there is a byte dislocation. At the beginning, I suspect that bind9 does not comply with the RFC? Later I thought the possibility was almost 0 ....
Then, I tried to intercept the packet to verify whether the packet sent by myself had a problem. Finally, I found the problem occurred at DNS. query. TCP ().
No problem was found after debugging using PDB. I only know that the last problem is caused by the to_wire () function, from Update. to_wire () to message. to_wire (), and then trace to render. get_wire () (this function is used to print the packet header) does not know how to call tlsa. to_wire Function
Okay ...... Well .... The final problem was solved by updating the dnspython compilation. It seems that there is no reference to it ......
2. Rdataclass during Delete
During tlsa Delete, the update object is printed and the DNS. rdataclass. In specified during update construction is changed to none. Although the last update result is not affected, I still don't quite understand why I should do this.
The parameters passed in to the delete function are tlsa objects,
149 ARGs = List (ARGs) 150 if isinstance (ARGs [0], DNS. RDATA. RDATA): # Return Value true, enter the branch 151 for RD in ARGs: 152 self. _ add_rr (name, 0, RD, DNS. rdataclass. none) # Set rdataclass to none, 153 else: # If it is input, argS 154 rdtype = args. pop (0) # Pop out RR type 155 If isinstance (rdtype, (STR, Unicode): 156 rdtype = DNS. rdatatype. from_text (rdtype) # if it is a type string representation, it is converted to the corresponding type object 157 if Len (ARGs) = 0: 158 rrset = self. find_rrset (SE Lf. authority, name, 159 self. zone_rdclass, rdtype, 160 DNS. rdatatype. none, 161 DNS. rdataclass. any, 162 true, true) 163 else: 164 for S in ARGs: 165 RD = DNS. RDATA. from_text (self. zone_rdclass, rdtype, seconds, 166 self. origin) # generate the tlsa object 167 self. _ add_rr (name, 0, RD, DNS. rdataclass. none) # or set it to none?
Why? Do you not need to match rdataclass during deletion?