Making DNS Rdatasets and RRsets

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