Making DNS Rdatasets and RRsets

dns.rdataset.from_text(rdclass, rdtype, ttl, *text_rdatas)[source]

Create an rdataset with the specified class, type, and TTL, and with the specified rdatas in text format.

Returns a dns.rdataset.Rdataset object.

dns.rdataset.from_text_list(rdclass, rdtype, ttl, text_rdatas, idna_codec=None, origin=None, relativize=True, relativize_to=None)[source]

Create an rdataset with the specified class, type, and TTL, and with the specified list of rdatas in text format.

idna_codec, a dns.name.IDNACodec, specifies the IDNA encoder/decoder to use; if None, the default IDNA 2003 encoder/decoder is used.

origin, a dns.name.Name (or None), the origin to use for relative names.

relativize, a bool. If true, name will be relativized.

relativize_to, a dns.name.Name (or None), the origin to use when relativizing names. If not set, the origin value will be used.

Returns a dns.rdataset.Rdataset object.

dns.rdataset.from_rdata(ttl, *rdatas)[source]

Create an rdataset with the specified TTL, and with the specified rdata objects.

Returns a dns.rdataset.Rdataset object.

dns.rdataset.from_rdata_list(ttl, rdatas)[source]

Create an rdataset with the specified TTL, and with the specified list of rdata objects.

Returns a dns.rdataset.Rdataset object.

dns.rrset.from_text(name, ttl, rdclass, rdtype, *text_rdatas)[source]

Create an RRset with the specified name, TTL, class, and type and with the specified rdatas in text format.

Returns a dns.rrset.RRset object.

dns.rrset.from_text_list(name, ttl, rdclass, rdtype, text_rdatas, idna_codec=None, origin=None, relativize=True, relativize_to=None)[source]

Create an RRset with the specified name, TTL, class, and type, and with the specified list of rdatas in text format.

idna_codec, a dns.name.IDNACodec, specifies the IDNA encoder/decoder to use; if None, the default IDNA 2003 encoder/decoder is used.

origin, a dns.name.Name (or None), the origin to use for relative names.

relativize, a bool. If true, name will be relativized.

relativize_to, a dns.name.Name (or None), the origin to use when relativizing names. If not set, the origin value will be used.

Returns a dns.rrset.RRset object.

dns.rrset.from_rdata(name, ttl, *rdatas)[source]

Create an RRset with the specified name and TTL, and with the specified rdata objects.

Returns a dns.rrset.RRset object.

dns.rrset.from_rdata_list(name, ttl, rdatas, idna_codec=None)[source]

Create an RRset with the specified name and TTL, and with the specified list of rdata objects.

idna_codec, a dns.name.IDNACodec, specifies the IDNA encoder/decoder to use; if None, the default IDNA 2003 encoder/decoder is used.

Returns a dns.rrset.RRset object.