I have all the resource record sets and resource types(cname,A,ns,mx)
. I wanted to create a dns file(BIND format) using easyzone
, dnspython
, dns
libraries in python.
But I am getting an error -
Attribute Error : 'str' object has no attribute 'is_absolute'
Here is my basic code-
from dns.zone import Zone
from dns.rdataclass import *
from dns.rdatatype import *
zone1 = Zone(origin='example.com.')
A_add = "example.com."
print "Adding record of type A:", A_add
rdataset = zone1.find_rdataset(A_add, rdtype=A, create=True)
rdata = dns.rdtypes.IN.A.A(IN, A, address="192.168.10.30")
rdataset.add(rdata, ttl=300)
I am getting error on rdataset = zone1.find_rdataset(A_add, rdtype=A, create=True)
.
How to create a dns file using any of the libraries mentioned above in python and how to resolve the issue?