OK, I can cause AttributeError: 'NoneType' object has no attribute 'header' by having an empty list of nameservers. So I think your problem is the python3-dns isn't, for some reason, discovering a usable nameserver.
What is in your /etc/resolv.conf and /etc/network/interfaces?
OK, I can cause AttributeError: 'NoneType' object has no attribute 'header' by having an empty list of nameservers. So I think your problem is the python3-dns isn't, for some reason, discovering a usable nameserver.
What is in your /etc/resolv.conf and /etc/network/ interfaces?
I also think py3dns should handle this better.