sdkagent

dnspython API reference

400 public APIs from dnspython (rthalley/dnspython) — 187 classes, 68 functions, 145 methods. Signatures extracted by static analysis of the actual source.

Repository: rthalley/dnspython

KindCount
Classes187
Functions68
Methods145

API list

funcdns._features.force(feature:str, enabled:bool) -> None
Force the status of *feature* to be *enabled*.
funcdns._features.have(feature:str) -> bool
Is *feature* available?
funcdns.asyncbackend.get_backend(name:str) -> Backend
Get the specified asynchronous backend.
funcdns.asyncbackend.get_default_backend() -> Backend
Get the default backend, initializing it if necessary.
funcdns.asyncbackend.set_default_backend(name:str) -> Backend
Set the default backend.
funcdns.asyncquery.send_tcp(sock:dns.asyncbackend.StreamSocket, what:dns.message.Message | bytes, expiration:float | None=None) -> tuple[int, float]
Send a DNS message to the specified TCP socket.
classdns.asyncresolver.Resolver
Asynchronous DNS stub resolver.
methoddns.asyncresolver.Resolver.canonical_name(name:dns.name.Name | str) -> dns.name.Name
Determine the canonical name of *name*.
funcdns.asyncresolver.canonical_name(name:dns.name.Name | str) -> dns.name.Name
Determine the canonical name of *name*.
funcdns.asyncresolver.reset_default_resolver() -> None
Re-initialize default asynchronous resolver.
funcdns.asyncresolver.resolve_address(ipaddr:str, *args:Any, **kwargs:Any) -> dns.resolver.Answer
Use a resolver to run a reverse query for PTR records.
classdns.btree.BTree
An in-memory BTree with copy-on-write and cursors.
methoddns.btree.BTree.cursor() -> Cursor[KT, ET]
Create a cursor.
methoddns.btree.BTree.delete_exact(element:ET) -> ET | None
Delete *element* from the BTree.
methoddns.btree.BTree.delete_key(key:KT) -> ET | None
Delete the element matching *key* from the BTree.
methoddns.btree.BTree.deregister_cursor(cursor:Cursor) -> None
Deregister a cursor from the automatic parking service.
methoddns.btree.BTree.insert_element(elt:ET, in_order:bool=False) -> ET | None
Insert the element into the BTree.
methoddns.btree.BTree.make_immutable()
Make the BTree immutable.
methoddns.btree.BTree.register_cursor(cursor:Cursor) -> None
Register a cursor for the automatic parking service.
methoddns.btree.BTree.visit_in_order(visit:Callable[[ET], None]) -> None
Call *visit*(element) on all elements in the tree in sorted order.
classdns.btree.BTreeDict
A MutableMapping implemented with a BTree.
classdns.btree.BTreeSet
A MutableSet implemented with a BTree.
classdns.btree.Cursor
A seekable cursor for a BTree.
methoddns.btree.Cursor.next() -> ET | None
Get the next element, or return None if on the right boundary.
methoddns.btree.Cursor.park()
Park the cursor.
methoddns.btree.Cursor.seek(key:KT, before:bool=True) -> None
Seek to the specified key.
methoddns.btree.Cursor.seek_first() -> None
Seek to the left boundary (i.e.
methoddns.btree.Cursor.seek_last() -> None
Seek to the right boundary (i.e.
classdns.btree.Element
All items stored in the BTree are Elements.
methoddns.btree.Element.key() -> KT
The key for this element; the returned type must implement comparison.
classdns.btree.Immutable
The BTree is immutable.
classdns.btree.KV
The BTree element type used in a ``BTreeDict``.
classdns.btree.Member
The BTree element type used in a ``BTreeSet``.
classdns.btreezone.Delegations
A sorted set of delegation-point names.
methoddns.btreezone.Delegations.get_delegation(name:dns.name.Name) -> tuple[dns.name.Name | None, bool]
Get the delegation applicable to *name*, if it exists.
methoddns.btreezone.Delegations.is_glue(name:dns.name.Name) -> bool
Is *name* glue, i.e.
classdns.btreezone.ImmutableNode
An immutable :py:class:`dns.btreezone.Node`.
classdns.btreezone.NodeFlags
Flags that classify a node's role in the zone.
classdns.btreezone.WritableVersion
A mutable version of a :py:class:`dns.btreezone.Zone`.
methoddns.btreezone.WritableVersion.delete_node(name:dns.name.Name) -> None
Delete the node at *name*, updating delegation tracking as needed.
classdns.btreezone.Zone
A versioned DNS zone backed by a BTree.
funcdns.dnssec.algorithm_from_text(text:str) -> Algorithm
Convert text into a DNSSEC algorithm value.
funcdns.dnssec.cds_rdataset_to_ds_rdataset(rdataset:dns.rdataset.Rdataset) -> dns.rdataset.Rdataset
Create a CDS record from DS.
funcdns.dnssec.dnskey_rdataset_to_cdnskey_rdataset(rdataset:dns.rdataset.Rdataset) -> dns.rdataset.Rdataset
Create a CDNSKEY record from DNSKEY.
funcdns.dnssec.key_id(key:DNSKEY | CDNSKEY) -> int
Return the key id (a 16-bit number) for the specified key.
funcdns.dnssec.make_cds(name:dns.name.Name | str, key:dns.rdata.Rdata, algorithm:DSDigest | str, origin:dns.name.Name | None=None) -> CDS
Create a CDS record for a DNSSEC key.
funcdns.dnssec.make_ds(name:dns.name.Name | str, key:dns.rdata.Rdata, algorithm:DSDigest | str, origin:dns.name.Name | None=None, policy:Policy | None=None, validating:bool=False) -> DS
Create a DS record for a DNSSEC key.
funcdns.dnssec.to_timestamp(value:datetime | str | float | int) -> int
Convert various format to a timestamp
funcdns.dnssecalgs.get_algorithm_cls(algorithm:int | str, prefix:AlgorithmPrefix=None) -> type[GenericPrivateKey]
Get Private Key class from Algorithm.
funcdns.dnssecalgs.get_algorithm_cls_from_dnskey(dnskey:DNSKEY) -> type[GenericPrivateKey]
Get Private Key class from DNSKEY.
funcdns.dnssecalgs.register_algorithm_cls(algorithm:int | str, algorithm_cls:type[GenericPrivateKey], name:dns.name.Name | str | None=None, oid:bytes | None=None) -> None
Register Algorithm Private Key class.
classdns.dnssectypes.DSDigest
DNSSEC Delegation Signer Digest Algorithm
classdns.dnssectypes.NSEC3Hash
NSEC3 hash algorithm
funcdns.e164.to_e164(name:dns.name.Name, origin:dns.name.Name | None=public_enum_domain, want_plus_prefix:bool=True) -> str
Convert an ENUM domain name into an E.164 number.
classdns.edns.ECSOption
EDNS Client Subnet (ECS, RFC7871)
classdns.edns.EDECode
Extended DNS Error (EDE) codes
classdns.edns.EDEOption
Extended DNS Error (EDE, RFC8914)
classdns.edns.FilteringContactOption
Filtering contact (FILTERING-CONTACT)
classdns.edns.FilteringDBOption
Filtering DB (FILTERING-DB)
classdns.edns.FilteringOrganizationOption
Filtering organization (FILTERING-ORGANIZATION)
classdns.edns.Option
Base class for all EDNS option types.
methoddns.edns.Option.from_wire_parser(otype:OptionType, parser:'dns.wire.Parser') -> 'Option'
Build an EDNS option object from wire format.
methoddns.edns.Option.to_wire(file:Any | None=None) -> bytes | None
Convert an option to wire format.
classdns.edns.OptionType
EDNS option type codes
funcdns.edns.get_option_class(otype:OptionType) -> Any
Return the class for the specified option type.
funcdns.edns.option_from_wire(otype:OptionType | str, wire:bytes, current:int, olen:int) -> Option
Build an EDNS option object from wire format.
funcdns.edns.option_from_wire_parser(otype:OptionType | str, parser:'dns.wire.Parser') -> Option
Build an EDNS option object from wire format.
funcdns.edns.register_type(implementation:Any, otype:OptionType) -> None
Register the implementation of an option type.
methoddns.enum.IntEnum.make(value:int | str) -> TIntEnum
Convert text or a value into an enumerated type, if possible.
classdns.exception.DNSException
Abstract base class shared by all dnspython exceptions.
classdns.exception.DeniedByPolicy
Denied by DNSSEC policy.
classdns.exception.FormError
DNS message is malformed.
classdns.exception.SyntaxError
Text input is malformed.
classdns.exception.Timeout
The DNS operation timed out.
classdns.exception.TooBig
The DNS message is too big.
classdns.exception.UnexpectedEnd
Text input ended unexpectedly.
classdns.exception.UnsupportedAlgorithm
The DNSSEC algorithm is not supported.
classdns.exception.ValidationFailure
The DNSSEC signature is invalid.
funcdns.flags.from_text(text:str) -> int
Convert a space-separated list of flag text values into a flags value.
funcdns.flags.to_text(flags:int) -> str
Convert a flags value into a space-separated list of flag text values.
funcdns.immutable.constify(o:Any) -> Any
Convert mutable types to immutable types.
funcdns.inet.af_for_address(text:str) -> int
Determine the address family of a textual-form network address.
funcdns.inet.inet_ntop(family:int, address:bytes) -> str
Convert the binary form of a network address into its textual form.
funcdns.inet.inet_pton(family:int, text:str) -> bytes
Convert the textual form of a network address into its binary form.
funcdns.inet.is_address(text:str) -> bool
Is the specified string an IPv4 or IPv6 address?
funcdns.inet.is_multicast(text:str) -> bool
Is the textual-form network address a multicast address?
funcdns.inet.low_level_address_tuple(high_tuple:tuple[str, int], af:int | None=None) -> Any
Given a "high-level" address tuple, i.e.
funcdns.ipv4.inet_aton(text:str | bytes) -> bytes
Convert an IPv4 address in text form to binary form.
funcdns.ipv4.inet_ntoa(address:bytes) -> str
Convert an IPv4 address in binary form to text form.
funcdns.ipv6.inet_aton(text:str | bytes, ignore_scope:bool=False) -> bytes
Convert an IPv6 address in text form to binary form.
funcdns.ipv6.inet_ntoa(address:bytes) -> str
Convert an IPv6 address in binary form to text form.
funcdns.ipv6.is_mapped(address:bytes) -> bool
Is the specified address a mapped IPv4 address?
classdns.message.AnswerForNXDOMAIN
The rcode is NXDOMAIN but an answer was found.
classdns.message.ChainTooLong
The CNAME chain is too long.
classdns.message.CopyMode
How should sections be copied when making an update response?
classdns.message.Message
A DNS message.
methoddns.message.Message.additional() -> list[dns.rrset.RRset]
The additional data section.
methoddns.message.Message.answer() -> list[dns.rrset.RRset]
The answer section.
methoddns.message.Message.authority() -> list[dns.rrset.RRset]
The authority section.
methoddns.message.Message.get_options(otype:dns.edns.OptionType) -> list[dns.edns.Option]
Return the list of options of the specified type.
methoddns.message.Message.is_response(other:'Message') -> bool
Is *other* a response to this message?
methoddns.message.Message.opcode() -> dns.opcode.Opcode
Return the opcode.
methoddns.message.Message.question() -> list[dns.rrset.RRset]
The question section.
methoddns.message.Message.rcode() -> dns.rcode.Rcode
Return the rcode.
methoddns.message.Message.section_count(section:SectionType) -> int
Returns the number of records in the specified section.
methoddns.message.Message.set_opcode(opcode:dns.opcode.Opcode) -> None
Set the opcode.
methoddns.message.Message.set_rcode(rcode:dns.rcode.Rcode) -> None
Set the rcode.
methoddns.message.Message.to_styled_text(style:MessageStyle) -> str
Convert the message to styled text.
methoddns.message.Message.to_text(origin:dns.name.Name | None=None, relativize:bool=True, style:MessageStyle | None=None, **kw:Any) -> str
Convert the message to text.
methoddns.message.Message.use_edns(edns:int | bool | None=0, ednsflags:int=0, payload:int=DEFAULT_EDNS_PAYLOAD, request_payload:int | None=None, options:list[dns.edns.Option] | None=None, pad:int=0) -> None
Configure EDNS behavior.
methoddns.message.Message.want_dnssec(wanted:bool=True) -> None
Enable or disable 'DNSSEC desired' flag in requests.
classdns.message.MessageSection
Message sections
classdns.message.MessageStyle
Message text styles.
classdns.message.NoPreviousName
No previous name was known.
classdns.message.NotQueryResponse
Message is not a response to a query.
classdns.message.ShortHeader
The DNS packet passed to from_wire() is too short.
classdns.message.Truncated
The truncated flag is set.
classdns.message.UnknownTSIGKey
A TSIG with an unknown key was received.
funcdns.message.from_file(f:Any, idna_codec:dns.name.IDNACodec | None=None, one_rr_per_rrset:bool=False) -> Message
Read the next text format message from the specified file.
classdns.name.BadEscape
An escaped code in a text format of DNS name is invalid.
classdns.name.BadLabelType
The label type in DNS name wire format is unknown.
classdns.name.BadPointer
A DNS compression pointer points forward instead of backward.
classdns.name.EmptyLabel
A DNS label is empty.
classdns.name.IDNA2003Codec
IDNA 2003 encoder/decoder.
methoddns.name.IDNA2003Codec.decode(label:bytes) -> str
Decode *label*.
methoddns.name.IDNA2003Codec.encode(label:str) -> bytes
Encode *label*.
classdns.name.IDNA2008Codec
IDNA 2008 encoder/decoder.
classdns.name.IDNACodec
Abstract base class for IDNA encoder/decoders.
classdns.name.IDNAException
IDNA processing raised an exception.
classdns.name.LabelTooLong
A DNS label is > 63 octets long.
classdns.name.Name
A DNS name.
methoddns.name.Name.choose_relativity(origin:'Name | None'=None, relativize:bool=True) -> 'Name'
Return a name with the relativity desired by the caller.
methoddns.name.Name.concatenate(other:'Name') -> 'Name'
Return a new name which is the concatenation of self and other.
methoddns.name.Name.fullcompare(other:'Name') -> tuple[NameRelation, int, int]
Compare two names, returning a 3-tuple ``(relation, order, nlabels)``.
methoddns.name.Name.is_absolute() -> bool
Is the most significant label of this name the root label?
methoddns.name.Name.is_subdomain(other:'Name') -> bool
Is self a subdomain of other?
methoddns.name.Name.is_superdomain(other:'Name') -> bool
Is self a superdomain of other?
methoddns.name.Name.is_wild() -> bool
Is this name wild?
methoddns.name.Name.parent() -> 'Name'
Return the parent of the name.
methoddns.name.Name.predecessor(origin:'Name', prefix_ok:bool=True) -> 'Name'
Return the maximal predecessor of the name in the DNSSEC ordering.
methoddns.name.Name.split(depth:int) -> tuple['Name', 'Name']
Split a name into a prefix and suffix names at the specified depth.
methoddns.name.Name.successor(origin:'Name', prefix_ok:bool=True) -> 'Name'
Return the minimal successor of the name in the DNSSEC ordering.
methoddns.name.Name.to_digestable(origin:'Name | None'=None) -> bytes
Convert name to a format suitable for digesting in hashes.
methoddns.name.Name.to_styled_text(style:NameStyle) -> str
Convert name to text format, applying the style.
methoddns.name.Name.to_text(omit_final_dot:bool=False, style:NameStyle | None=None) -> str
Convert name to DNS text format.
methoddns.name.Name.to_unicode(omit_final_dot:bool=False, idna_codec:IDNACodec | None=None, style:NameStyle | None=None) -> str
Convert name to DNS text format.
methoddns.name.Name.to_wire(file:Any | None=None, compress:CompressType | None=None, origin:'Name | None'=None, canonicalize:bool=False) -> bytes | None
Convert name to wire format, possibly compressing it.
classdns.name.NameRelation
Name relation result from fullcompare().
classdns.name.NameStyle
Name text styles.
classdns.name.NameTooLong
A DNS name is > 255 octets long.
funcdns.name.from_text(text:bytes | str, origin:Name | None=root, idna_codec:IDNACodec | None=None) -> Name
Convert text into a :py:class:`dns.name.Name` object.
funcdns.name.from_unicode(text:str, origin:Name | None=root, idna_codec:IDNACodec | None=None) -> Name
Convert unicode text into a :py:class:`dns.name.Name` object.
funcdns.name.set_default_idna_codec(idna_codec:IDNACodec)
Set the default IDNA codec.
classdns.namedict.NameDict
A dictionary whose keys are dns.name.Name objects.
classdns.node.Node
A Node is a set of rdatasets.
methoddns.node.Node.classify() -> NodeKind
Classify a node.
methoddns.node.Node.replace_rdataset(replacement:dns.rdataset.Rdataset) -> None
Replace an rdataset.
methoddns.node.Node.to_styled_text(style:NodeStyle, name:dns.name.Name) -> str
Convert a node to text format.
methoddns.node.Node.to_text(name:dns.name.Name, style:NodeStyle | None=None, **kw:Any) -> str
Convert a node to text format.
classdns.node.NodeKind
Rdatasets in nodes
classdns.node.NodeStyle
Node text styles.
classdns.opcode.UnknownOpcode
An DNS opcode is unknown.
funcdns.opcode.from_flags(flags:int) -> Opcode
Extract an opcode from DNS message flags.
funcdns.opcode.from_text(text:str) -> Opcode
Convert text into an opcode.
funcdns.opcode.is_update(flags:int) -> bool
Is the opcode in flags UPDATE?
funcdns.opcode.to_flags(value:Opcode) -> int
Convert an opcode to a value suitable for ORing into DNS message flags.
funcdns.opcode.to_text(value:Opcode) -> str
Convert an opcode to text.
classdns.query.BadResponse
A DNS query response does not respond to the question asked.
classdns.query.HTTPVersion
Which version of HTTP should be used?
classdns.query.UDPMode
How should UDP be used in an IXFR from :py:func:`inbound_xfr()`?
classdns.query.UnexpectedSource
A DNS query response came from an unexpected address or port.
funcdns.query.make_socket(af:socket.AddressFamily | int, type:socket.SocketKind, source:Any | None=None) -> socket.socket
Make a socket using the module's ``socket_factory``.
funcdns.query.send_tcp(sock:Any, what:dns.message.Message | bytes, expiration:float | None=None) -> tuple[int, float]
Send a DNS message to the specified TCP socket.
funcdns.query.send_udp(sock:Any, what:dns.message.Message | bytes, destination:Any, expiration:float | None=None) -> tuple[int, float]
Send a DNS message to the specified UDP socket.
classdns.rcode.UnknownRcode
A DNS rcode is unknown.
funcdns.rcode.from_flags(flags:int, ednsflags:int) -> Rcode
Return the rcode value encoded by flags and ednsflags.
funcdns.rcode.from_text(text:str) -> Rcode
Convert text into an rcode.
funcdns.rcode.to_flags(value:Rcode) -> tuple[int, int]
Return a ``(flags, ednsflags)`` tuple which encodes the rcode.
funcdns.rcode.to_text(value:Rcode, tsig:bool=False) -> str
Convert rcode into text.
classdns.rdata.Rdata
Base class for all DNS rdata types.
methoddns.rdata.Rdata.covers() -> dns.rdatatype.RdataType
Return the type a Rdata covers.
methoddns.rdata.Rdata.replace(**kwargs:Any) -> 'Rdata'
Create a new Rdata instance based on the instance replace was invoked on.
methoddns.rdata.Rdata.to_digestable(origin:dns.name.Name | None=None) -> bytes
Convert rdata to a format suitable for digesting in hashes.
methoddns.rdata.Rdata.to_styled_text(style:RdataStyle) -> str
Convert an rdata to styled text format.
methoddns.rdata.Rdata.to_text(origin:dns.name.Name | None=None, relativize:bool=True, style:RdataStyle | None=None, **kw:Any) -> str
Convert an rdata to text format.
methoddns.rdata.Rdata.to_wire(file:Any | None=None, compress:dns.name.CompressType | None=None, origin:dns.name.Name | None=None, canonicalize:bool=False) -> bytes | None
Convert an rdata to wire format.
classdns.rdata.RdatatypeExists
DNS rdatatype already exists.
classdns.rdataclass.RdataClass
DNS Rdata Class
classdns.rdataclass.UnknownRdataclass
A DNS class is unknown.
funcdns.rdataclass.from_text(text:str) -> RdataClass
Convert text into a DNS rdata class value.
funcdns.rdataclass.is_metaclass(rdclass:RdataClass) -> bool
True if the specified class is a metaclass.
funcdns.rdataclass.to_text(value:RdataClass) -> str
Convert a DNS rdata class value to text.
classdns.rdataset.ImmutableRdataset
An immutable DNS rdataset.
classdns.rdataset.Rdataset
A DNS rdataset.
methoddns.rdataset.Rdataset.add(rd:dns.rdata.Rdata, ttl:int | None=None) -> None
Add the specified rdata to the rdataset.
methoddns.rdataset.Rdataset.to_styled_text(style:RdatasetStyle, name:dns.name.Name | None=None) -> str
Convert the rdataset into styled text format.
methoddns.rdataset.Rdataset.update(other)
Add all rdatas in other to self.
methoddns.rdataset.Rdataset.update_ttl(ttl:int) -> None
Perform TTL minimization.
classdns.rdatatype.RdataType
DNS Rdata Type
classdns.rdatatype.UnknownRdatatype
DNS resource record type is unknown.
funcdns.rdatatype.from_text(text:str) -> RdataType
Convert text into a DNS rdata type value.
funcdns.rdatatype.is_metatype(rdtype:RdataType) -> bool
True if the specified type is a metatype.
funcdns.rdatatype.is_singleton(rdtype:RdataType) -> bool
Is the specified type a singleton type?
funcdns.rdatatype.register_type(rdtype:RdataType, rdtype_text:str, is_singleton:bool=False) -> None
Dynamically register an rdatatype.
funcdns.rdatatype.to_text(value:RdataType) -> str
Convert a DNS rdata type value to text.
classdns.rdtypes.ANY.AFSDB.AFSDB
AFSDB record
methoddns.rdtypes.ANY.AFSDB.AFSDB.hostname() -> dns.name.Name
the AFSDB hostname
methoddns.rdtypes.ANY.AFSDB.AFSDB.subtype() -> int
the AFSDB subtype
classdns.rdtypes.ANY.AMTRELAY.AMTRELAY
AMTRELAY record
classdns.rdtypes.ANY.AVC.AVC
AVC record
classdns.rdtypes.ANY.BRID.BRID
BRID record See RFC 9886
classdns.rdtypes.ANY.CAA.CAA
CAA (Certification Authority Authorization) record
classdns.rdtypes.ANY.CDNSKEY.CDNSKEY
CDNSKEY record
classdns.rdtypes.ANY.CDS.CDS
CDS record
classdns.rdtypes.ANY.CERT.CERT
CERT record
classdns.rdtypes.ANY.CSYNC.CSYNC
CSYNC record
classdns.rdtypes.ANY.DLV.DLV
DLV record
classdns.rdtypes.ANY.DNAME.DNAME
DNAME record
classdns.rdtypes.ANY.DNSKEY.DNSKEY
DNSKEY record
classdns.rdtypes.ANY.DS.DS
DS record
classdns.rdtypes.ANY.DSYNC.DSYNC
DSYNC record
classdns.rdtypes.ANY.DSYNC.Scheme
DSYNC SCHEME
classdns.rdtypes.ANY.DSYNC.UnknownScheme
Unknown DSYNC scheme
classdns.rdtypes.ANY.EUI48.EUI48
EUI48 record
classdns.rdtypes.ANY.EUI64.EUI64
EUI64 record
classdns.rdtypes.ANY.GPOS.GPOS
GPOS record
methoddns.rdtypes.ANY.GPOS.GPOS.float_altitude()
altitude as a floating point value
methoddns.rdtypes.ANY.GPOS.GPOS.float_latitude()
latitude as a floating point value
methoddns.rdtypes.ANY.GPOS.GPOS.float_longitude()
longitude as a floating point value
classdns.rdtypes.ANY.HHIT.HHIT
HHIT record See RFC 9886
classdns.rdtypes.ANY.HINFO.HINFO
HINFO record
classdns.rdtypes.ANY.HIP.HIP
HIP record
classdns.rdtypes.ANY.ISDN.ISDN
ISDN record
classdns.rdtypes.ANY.KEY.KEY
KEY record
classdns.rdtypes.ANY.L32.L32
L32 record
classdns.rdtypes.ANY.L64.L64
L64 record
classdns.rdtypes.ANY.LOC.LOC
LOC record
methoddns.rdtypes.ANY.LOC.LOC.float_latitude()
latitude as a floating point value
methoddns.rdtypes.ANY.LOC.LOC.float_longitude()
longitude as a floating point value
classdns.rdtypes.ANY.LP.LP
LP record
classdns.rdtypes.ANY.MX.MX
MX record
classdns.rdtypes.ANY.NID.NID
NID record
classdns.rdtypes.ANY.NINFO.NINFO
NINFO record
classdns.rdtypes.ANY.NS.NS
NS record
classdns.rdtypes.ANY.NSEC.NSEC
NSEC record
classdns.rdtypes.ANY.NSEC3.NSEC3
NSEC3 record
classdns.rdtypes.ANY.NSEC3PARAM.NSEC3PARAM
NSEC3PARAM record
classdns.rdtypes.ANY.OPENPGPKEY.OPENPGPKEY
OPENPGPKEY record
classdns.rdtypes.ANY.OPT.OPT
OPT record
methoddns.rdtypes.ANY.OPT.OPT.payload()
payload size
classdns.rdtypes.ANY.PTR.PTR
PTR record
classdns.rdtypes.ANY.RESINFO.RESINFO
RESINFO record
classdns.rdtypes.ANY.RP.RP
RP record
classdns.rdtypes.ANY.RRSIG.RRSIG
RRSIG record
classdns.rdtypes.ANY.RT.RT
RT record
classdns.rdtypes.ANY.SIG.SIG
SIG record
classdns.rdtypes.ANY.SMIMEA.SMIMEA
SMIMEA record
classdns.rdtypes.ANY.SOA.SOA
SOA record
classdns.rdtypes.ANY.SPF.SPF
SPF record
classdns.rdtypes.ANY.SSHFP.SSHFP
SSHFP record
classdns.rdtypes.ANY.TKEY.TKEY
TKEY Record
classdns.rdtypes.ANY.TLSA.TLSA
TLSA record
classdns.rdtypes.ANY.TSIG.TSIG
TSIG record
classdns.rdtypes.ANY.TXT.TXT
TXT record
classdns.rdtypes.ANY.URI.URI
URI record
classdns.rdtypes.ANY.WALLET.WALLET
WALLET record
classdns.rdtypes.ANY.X25.X25
X25 record
classdns.rdtypes.ANY.ZONEMD.ZONEMD
ZONEMD record
classdns.rdtypes.CH.A.A
A record for Chaosnet
classdns.rdtypes.IN.A.A
A record.
classdns.rdtypes.IN.AAAA.AAAA
AAAA record.
classdns.rdtypes.IN.APL.APL
APL record.
classdns.rdtypes.IN.APL.APLItem
An APL list item.
classdns.rdtypes.IN.DHCID.DHCID
DHCID record
classdns.rdtypes.IN.HTTPS.HTTPS
HTTPS record
classdns.rdtypes.IN.IPSECKEY.IPSECKEY
IPSECKEY record
classdns.rdtypes.IN.KX.KX
KX record
classdns.rdtypes.IN.NAPTR.NAPTR
NAPTR record
classdns.rdtypes.IN.NSAP.NSAP
NSAP record.
classdns.rdtypes.IN.NSAP_PTR.NSAP_PTR
NSAP-PTR record
classdns.rdtypes.IN.PX.PX
PX record.
classdns.rdtypes.IN.SRV.SRV
SRV record
classdns.rdtypes.IN.SVCB.SVCB
SVCB record
classdns.rdtypes.IN.WKS.WKS
WKS record
classdns.rdtypes.dnskeybase.DNSKEYBase
Base class for rdata that is like a DNSKEY record
methoddns.rdtypes.dnskeybase.DNSKEYBase.key_id() -> int
Return the key id (a 16-bit number) for the specified key.
classdns.rdtypes.dsbase.DSBase
Base class for rdata that is like a DS record
classdns.rdtypes.euibase.EUIBase
EUIxx record
classdns.rdtypes.mxbase.MXBase
Base class for rdata that is like an MX record.
classdns.rdtypes.nsbase.NSBase
Base class for rdata that is like an NS record.
classdns.rdtypes.rrsigbase.BadSigTime
Time in DNS SIG or RRSIG resource record cannot be parsed.
classdns.rdtypes.rrsigbase.RRSIGBase
Base class for rdata that is like a RRSIG record
classdns.rdtypes.svcbbase.ALPNParam
The alpn parameter.
classdns.rdtypes.svcbbase.DoCPathParam
The docpath parameter.
classdns.rdtypes.svcbbase.GenericParam
Generic SVCB parameter
classdns.rdtypes.svcbbase.Param
Abstract base class for SVCB parameters
classdns.rdtypes.svcbbase.ParamKey
SVCB ParamKey
classdns.rdtypes.svcbbase.SVCBBase
Base class for SVCB-like records
classdns.rdtypes.svcbbase.UnknownParamKey
Unknown SVCB ParamKey
classdns.rdtypes.tlsabase.TLSABase
Base class for TLSA and SMIMEA records
classdns.rdtypes.txtbase.TXTBase
Base class for rdata that is like a TXT record (see RFC 1035).
classdns.rdtypes.util.Bitmap
A helper class for the NSEC/NSEC3/CSYNC type bitmaps
classdns.renderer.Renderer
Helper class for building DNS wire-format messages.
methoddns.renderer.Renderer.add_question(qname, rdtype, rdclass=dns.rdataclass.IN)
Add a question to the message.
methoddns.renderer.Renderer.get_wire()
Return the wire format message.
methoddns.renderer.Renderer.release_reserved() -> None
Release the reserved bytes.
methoddns.renderer.Renderer.reserve(size:int) -> None
Reserve *size* bytes.
methoddns.renderer.Renderer.write_header()
Write the DNS message header.
classdns.resolver.Answer
DNS stub resolver answer.
classdns.resolver.Answers
A dict of DNS stub resolver answers, indexed by type.
classdns.resolver.BaseResolver
DNS stub resolver.
methoddns.resolver.BaseResolver.read_registry() -> None
Extract resolver configuration from the Windows registry.
methoddns.resolver.BaseResolver.read_resolv_conf(f:Any) -> None
Process *f* as a file in the /etc/resolv.conf format.
methoddns.resolver.BaseResolver.reset() -> None
Reset all resolver configuration to the defaults.
methoddns.resolver.BaseResolver.set_flags(flags:int) -> None
Override the default query flags.
methoddns.resolver.BaseResolver.use_edns(edns:int | bool | None=0, ednsflags:int=0, payload:int=dns.message.DEFAULT_EDNS_PAYLOAD, options:list[dns.edns.Option] | None=None) -> None
Configure EDNS behavior.
methoddns.resolver.BaseResolver.use_tsig(keyring:Any, keyname:dns.name.Name | str | None=None, algorithm:dns.name.Name | str=dns.tsig.default_algorithm) -> None
Add a TSIG signature to each query.
classdns.resolver.Cache
Simple thread-safe DNS answer cache.
methoddns.resolver.Cache.flush(key:CacheKey | None=None) -> None
Flush the cache.
methoddns.resolver.Cache.get(key:CacheKey) -> Answer | None
Get the answer associated with *key*, or ``None`` if not cached.
methoddns.resolver.Cache.put(key:CacheKey, value:Answer) -> None
Associate *key* with *value* in the cache.
classdns.resolver.CacheStatistics
Cache Statistics
classdns.resolver.EmptyHostAnswers
The HostAnswers has no addresses
classdns.resolver.LRUCache
Thread-safe, bounded, least-recently-used DNS answer cache.
methoddns.resolver.LRUCache.flush(key:CacheKey | None=None) -> None
Flush the cache.
methoddns.resolver.LRUCache.get(key:CacheKey) -> Answer | None
Get the answer associated with *key*.
methoddns.resolver.LRUCache.get_hits_for_key(key:CacheKey) -> int
Return the number of cache hits associated with the specified key.
methoddns.resolver.LRUCache.put(key:CacheKey, value:Answer) -> None
Associate key and value in the cache.
classdns.resolver.LRUCacheNode
LRUCache node.
classdns.resolver.LifetimeTimeout
The resolution lifetime expired.
classdns.resolver.NXDOMAIN
The DNS query name does not exist.
methoddns.resolver.NXDOMAIN.canonical_name()
Return the unresolved canonical name.
methoddns.resolver.NXDOMAIN.qnames()
All of the names that were tried.
methoddns.resolver.NXDOMAIN.response(qname)
The response for query *qname*.
classdns.resolver.NoAnswer
The DNS response does not contain an answer to the question.
classdns.resolver.NoMetaqueries
DNS metaqueries are not allowed.
classdns.resolver.NoNameservers
All nameservers failed to answer the query.
classdns.resolver.NoRootSOA
There is no SOA RR at the DNS root name.
classdns.resolver.Resolver
DNS stub resolver.
methoddns.resolver.Resolver.canonical_name(name:dns.name.Name | str) -> dns.name.Name
Determine the canonical name of *name*.
methoddns.resolver.Resolver.resolve_address(ipaddr:str, *args:Any, **kwargs:Any) -> Answer
Use a resolver to run a reverse query for PTR records.
methoddns.resolver.Resolver.resolve_name(name:dns.name.Name | str, family:int=socket.AF_UNSPEC, **kwargs:Any) -> HostAnswers
Use a resolver to query for address records.
classdns.resolver.YXDOMAIN
The DNS query name is too long after DNAME substitution.
funcdns.resolver.canonical_name(name:dns.name.Name | str) -> dns.name.Name
Determine the canonical name of *name*.
funcdns.resolver.get_default_resolver() -> Resolver
Get the default resolver, initializing it if necessary.
funcdns.resolver.reset_default_resolver() -> None
Re-initialize default resolver.
funcdns.resolver.resolve_address(ipaddr:str, *args:Any, **kwargs:Any) -> Answer
Use a resolver to run a reverse query for PTR records.
funcdns.resolver.resolve_name(name:dns.name.Name | str, family:int=socket.AF_UNSPEC, **kwargs:Any) -> HostAnswers
Use a resolver to query for address records.
funcdns.resolver.restore_system_resolver() -> None
Undo the effects of prior override_system_resolver().
classdns.rrset.RRset
A DNS RRset (named rdataset).
methoddns.rrset.RRset.match(*args:Any, **kwargs:Any) -> bool
Does this rrset match the specified attributes?
methoddns.rrset.RRset.to_rdataset() -> dns.rdataset.Rdataset
Convert an RRset into an Rdataset.
methoddns.rrset.RRset.to_styled_text(style:dns.rdataset.RdatasetStyle) -> str
Convert the RRset to styled text.
methoddns.rrset.RRset.to_text(origin:dns.name.Name | None=None, relativize:bool=True, want_comments:bool=False, style:dns.rdataset.RdatasetStyle | None=None, **kw:Any) -> str
Convert the RRset into DNS zone file format.
methoddns.rrset.RRset.to_wire(file:Any, compress:dns.name.CompressType | None=None, origin:dns.name.Name | None=None, **kw:Any) -> int
Convert the RRset to wire format.
classdns.set.Set
A simple set class.
methoddns.set.Set.add(item)
Add an item to the set.
methoddns.set.Set.clear()
Make the set empty.
methoddns.set.Set.copy()
Make a (shallow) copy of the set.
methoddns.set.Set.discard(item)
Remove an item from the set if present.
methoddns.set.Set.issubset(other)
Is this set a subset of *other*?
methoddns.set.Set.issuperset(other)
Is this set a superset of *other*?
methoddns.set.Set.pop()
Remove an arbitrary item from the set.
methoddns.set.Set.remove(item)
Remove an item from the set.
classdns.style.BaseStyle
All text styles
classdns.tokenizer.Token
A DNS zone file format token.
classdns.tokenizer.Tokenizer
A DNS zone file format tokenizer.
methoddns.tokenizer.Tokenizer.as_identifier(token:Token) -> str
Try to interpret the token as an identifier.
methoddns.tokenizer.Tokenizer.as_int(token:Token, base:int=10) -> int
Try to interpret the token as an unsigned integer.
methoddns.tokenizer.Tokenizer.as_name(token:Token, origin:dns.name.Name | None=None, relativize:bool=False, relativize_to:dns.name.Name | None=None) -> dns.name.Name
Try to interpret the token as a DNS name.
methoddns.tokenizer.Tokenizer.as_string(token:Token, max_length:int | None=None) -> str
Try to interpret the token as a string.
methoddns.tokenizer.Tokenizer.as_uint16(token:Token, base:int=10) -> int
Try to interpret the token as an unsigned 16-bit integer.
methoddns.tokenizer.Tokenizer.as_uint32(token:Token, base:int=10) -> int
Try to interpret the token as an unsigned 32-bit integer.
methoddns.tokenizer.Tokenizer.as_uint48(token:Token, base:int=10) -> int
Try to interpret the token as an unsigned 48-bit integer.
methoddns.tokenizer.Tokenizer.as_uint8(token:Token) -> int
Try to interpret the token as an unsigned 8-bit integer.
methoddns.tokenizer.Tokenizer.concatenate_remaining_identifiers(allow_empty:bool=False) -> str
Read the remaining tokens on the line, which should be identifiers.
methoddns.tokenizer.Tokenizer.get(want_leading:bool=False, want_comment:bool=False) -> Token
Get the next token.
methoddns.tokenizer.Tokenizer.get_identifier() -> str
Read the next token, which should be an identifier.
methoddns.tokenizer.Tokenizer.get_int(base:int=10) -> int
Read the next token and interpret it as an unsigned integer.
methoddns.tokenizer.Tokenizer.get_name(origin:dns.name.Name | None=None, relativize:bool=False, relativize_to:dns.name.Name | None=None) -> dns.name.Name
Read the next token and interpret it as a DNS name.
methoddns.tokenizer.Tokenizer.get_remaining(max_tokens:int | None=None) -> list[Token]
Return the remaining tokens on the line, until an EOL or EOF is seen.
methoddns.tokenizer.Tokenizer.get_string(max_length:int | None=None) -> str
Read the next token and interpret it as a string.
methoddns.tokenizer.Tokenizer.get_ttl() -> int
Read the next token and interpret it as a DNS TTL.
methoddns.tokenizer.Tokenizer.get_uint16(base:int=10) -> int
Read the next token and interpret it as a 16-bit unsigned integer.
methoddns.tokenizer.Tokenizer.get_uint32(base:int=10) -> int
Read the next token and interpret it as a 32-bit unsigned integer.
methoddns.tokenizer.Tokenizer.get_uint48(base:int=10) -> int
Read the next token and interpret it as a 48-bit unsigned integer.
methoddns.tokenizer.Tokenizer.get_uint8() -> int
Read the next token and interpret it as an 8-bit unsigned integer.
methoddns.tokenizer.Tokenizer.next()
Return the next item in an iteration.
methoddns.tokenizer.Tokenizer.skip_whitespace() -> int
Consume input until a non-whitespace character is encountered.
methoddns.tokenizer.Tokenizer.unget(token:Token) -> None
Unget a token.
methoddns.tokenizer.Tokenizer.where() -> tuple[str, int]
Return the current location in the input.
classdns.transaction.AlreadyEnded
Tried to use an already-ended transaction.
classdns.transaction.ReadOnly
Tried to write to a read-only transaction.
methoddns.transaction.Transaction.add(*args:Any) -> None
Add records.
methoddns.transaction.Transaction.changed() -> bool
Has this transaction changed anything?
methoddns.transaction.Transaction.check_delete_name(check:CheckDeleteNameType) -> None
Call *check* before putting (storing) an rdataset.
methoddns.transaction.Transaction.check_delete_rdataset(check:CheckDeleteRdatasetType) -> None
Call *check* before deleting an rdataset.
methoddns.transaction.Transaction.check_put_rdataset(check:CheckPutRdatasetType) -> None
Call *check* before putting (storing) an rdataset.
methoddns.transaction.Transaction.commit() -> None
Commit the transaction.
methoddns.transaction.Transaction.delete(*args:Any) -> None
Delete records.

About this data

These signatures were extracted from the public source of rthalley/dnspython using Python's ast module. Argument names, default values, type annotations and return types are taken verbatim from the code. Implementation bodies are never stored. See how it works for details.

Back to all 805 libraries