dnspython zone transfer fails

82 views Asked by At

I try to start a zone transfer with dnspython for the whole .ch domain (https://www.switch.ch/open-data/#tab-c5442a19-67cf-11e8-9cf6-5254009dc73c-3). This needs a tsig key, which can be passed to dnspython. But somehow I seem to be doing it wrong, as I always get an error

dns.name.NeedAbsoluteNameOrOrigin: An attempt was made to convert a non-absolute name to
    wire when there was also a non-absolute (or missing) origin.

The code I'm running is this (you need to install dnspython first):

tsig_zonedata = {
        "secret": dns.tsig.Key("sig-zonedata-ch-public-21-01.ch.", "stZwEGApYumtXkh73qMLPqfbIDozWKZLkqRvcjKSpRnsor6A6MxixRL6C2HeSVBQNfMW4wer+qjS0ZSfiWiJ3Q==", 'hmac-sha512'),
        "algorithm": 'hmac-sha512',
}

query = dns.query.xfr("zonedata.switch.ch","ch",keyring=tsig_zonedata, keyalgorithm='hmac-sha512', relativize=False, source="ch")
next(query)

I guess the issue is in the dictionary, but I cannot find an example of how it would have to look like. Any ideas on how I can solve this?

0

There are 0 answers