Closed yeti9990 closed 3 months ago
Although admittedly surprising, this is not a bug per se. It's more of a design mistake we can't easily fix due to backwards compatibility. The documentation for both dns.query.xfr()
and dns.zone.from_xfr()
both say that it is essential that the relativization settings in the two functions match. If you just add relativize=False
to your call to dns.query.xfr()
it will work.
We're gradually shifting to using dns.query.inbound_xfr()
instead as it can do IXFR and is generally friendlier, but it doesn't have a friendly TSIG interface yet.
We're gradually shifting to using
dns.query.inbound_xfr()
instead as it can do IXFR and is generally friendlier, but it doesn't have a friendly TSIG interface yet.
I'm not sure that I agree with the "yet" part - the new interface takes a Message
rather than a zone name, which is much more flexible, because there are many customizations that can be made to the message before calling inbound_xfr
, including specifying a TSIG key.
Describe the bug dns.zone.from_xfr() method is failing with ValueError: origin parameter must be an absolute name when
relativize=False
on a valid zone.To Reproduce The following code is producing this odd result:
This produces the following error:
If I set
relativize=True
, the try/except works, and I can see thatz.origin
prints to a valid FQDN equal to the zone name, and the zone is output to text using fully qualified domain names i.e. the records are NOT relativized.When the function works the zone or origin is printed out, why is "example.com." not considered an abosolute name?
Context (please complete the following information):
Python 3.10.13