Making DNS Rdatasets and RRsets

dns.rdataset.from_text(rdclass: Union[dns.rdataclass.RdataClass, str], rdtype: Union[dns.rdatatype.RdataType, str], ttl: int, *text_rdatas: Any) dns.rdataset.Rdataset[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: Union[dns.rdataclass.RdataClass, str], rdtype: Union[dns.rdatatype.RdataType, str], ttl: int, text_rdatas: Collection[str], idna_codec: Optional[dns.name.IDNACodec] = None, origin: Optional[dns.name.Name] = None, relativize: bool = True, relativize_to: Optional[dns.name.Name] = None) dns.rdataset.Rdataset[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: int, *rdatas: Any) dns.rdataset.Rdataset[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: int, rdatas: Collection[dns.rdata.Rdata]) dns.rdataset.Rdataset[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: Union[dns.name.Name, str], ttl: int, rdclass: Union[dns.rdataclass.RdataClass, str], rdtype: Union[dns.rdatatype.RdataType, str], *text_rdatas: Any) dns.rrset.RRset[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: Union[dns.name.Name, str], ttl: int, rdclass: Union[dns.rdataclass.RdataClass, str], rdtype: Union[dns.rdatatype.RdataType, str], text_rdatas: Collection[str], idna_codec: Optional[dns.name.IDNACodec] = None, origin: Optional[dns.name.Name] = None, relativize: bool = True, relativize_to: Optional[dns.name.Name] = None) dns.rrset.RRset[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: Union[dns.name.Name, str], ttl: int, *rdatas: Any) dns.rrset.RRset[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: Union[dns.name.Name, str], ttl: int, rdatas: Collection[dns.rdata.Rdata], idna_codec: Optional[dns.name.IDNACodec] = None) dns.rrset.RRset[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.