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.

Return type:

dns.rdataset.Rdataset

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.

Parameters:
  • idna_codec (dns.name.IDNACodec or None) – Specifies the IDNA encoder/decoder. If None, the default IDNA 2003 encoder/decoder is used.

  • origin (dns.name.Name or None) – The origin to use for relative names.

  • relativize (bool) – If True, names will be relativized.

  • relativize_to (dns.name.Name or None) – The origin to use when relativizing names. If not set, origin is used.

Return type:

dns.rdataset.Rdataset

dns.rdataset.from_rdata(ttl: int, *rdatas: Any) Rdataset[source]

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

Return type:

dns.rdataset.Rdataset

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.

Return type:

dns.rdataset.Rdataset

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.

Return type:

dns.rrset.RRset

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.

Parameters:
  • idna_codec (dns.name.IDNACodec or None) – Specifies the IDNA encoder/decoder. If None, the default IDNA 2003 encoder/decoder is used.

  • origin (dns.name.Name or None) – The origin to use for relative names.

  • relativize (bool) – If True, names will be relativized.

  • relativize_to (dns.name.Name or None) – The origin to use when relativizing names. If not set, origin is used.

Return type:

dns.rrset.RRset

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.

Return type:

dns.rrset.RRset

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.

Parameters:

idna_codec (dns.name.IDNACodec or None) – Specifies the IDNA encoder/decoder. If None, the default IDNA 2003 encoder/decoder is used.

Return type:

dns.rrset.RRset