datatypes (version 1.0.0)
index
datatypes.py

DNS types, constants, and RFC-compliant data structures.

 
Classes
       
builtins.object
AAAARecord
ARecord
CAARecord
CNAMERecord
DNSFlags
DNSHeader
DNSMessage
DNSQuestion
DNSResourceRecord
MXRecord
NSRecord
PTRRecord
SOARecord
SRVRecord
TXTRecord
enum.IntEnum(builtins.int, enum.ReprEnum)
Opcode
RecordClass
RecordType
ResponseCode

 
class AAAARecord(builtins.object)
    AAAARecord(address: str) -> None
 
Represents an IPv6 address (AAAA record).
 
  Methods defined here:
__eq__(self, other) from AAAARecord
__init__(self, address: str) -> None from AAAARecord
__replace__ = _replace(self, /, **changes) from dataclasses
__repr__(self) from AAAARecord

Data descriptors defined here:
__dict__
dictionary for instance variables
__weakref__
list of weak references to the object

Data and other attributes defined here:
__dataclass_fields__ = {'address': Field(name='address',type=<class 'str'>,default=...xy({}),kw_only=False,doc=None,_field_type=_FIELD)}
__dataclass_params__ = _DataclassParams(init=True,repr=True,eq=True,ord...rue,kw_only=False,slots=False,weakref_slot=False)
__hash__ = None
__match_args__ = ('address',)

 
class ARecord(builtins.object)
    ARecord(address: str) -&gt; None
 
Represents an IPv4 address (A record).
 
  Methods defined here:
__eq__(self, other) from ARecord
__init__(self, address: str) -> None from ARecord
__replace__ = _replace(self, /, **changes) from dataclasses
__repr__(self) from ARecord

Data descriptors defined here:
__dict__
dictionary for instance variables
__weakref__
list of weak references to the object

Data and other attributes defined here:
__dataclass_fields__ = {'address': Field(name='address',type=<class 'str'>,default=...xy({}),kw_only=False,doc=None,_field_type=_FIELD)}
__dataclass_params__ = _DataclassParams(init=True,repr=True,eq=True,ord...rue,kw_only=False,slots=False,weakref_slot=False)
__hash__ = None
__match_args__ = ('address',)

 
class CAARecord(builtins.object)
    CAARecord(flags: int, tag: str, value: str) -&gt; None
 
Represents a Certification Authority Authorization record.
 
  Methods defined here:
__eq__(self, other) from CAARecord
__init__(self, flags: int, tag: str, value: str) -> None from CAARecord
__replace__ = _replace(self, /, **changes) from dataclasses
__repr__(self) from CAARecord

Data descriptors defined here:
__dict__
dictionary for instance variables
__weakref__
list of weak references to the object

Data and other attributes defined here:
__dataclass_fields__ = {'flags': Field(name='flags',type=<class 'int'>,default=<d...xy({}),kw_only=False,doc=None,_field_type=_FIELD), 'tag': Field(name='tag',type=<class 'str'>,default=<dat...xy({}),kw_only=False,doc=None,_field_type=_FIELD), 'value': Field(name='value',type=<class 'str'>,default=<d...xy({}),kw_only=False,doc=None,_field_type=_FIELD)}
__dataclass_params__ = _DataclassParams(init=True,repr=True,eq=True,ord...rue,kw_only=False,slots=False,weakref_slot=False)
__hash__ = None
__match_args__ = ('flags', 'tag', 'value')

 
class CNAMERecord(builtins.object)
    CNAMERecord(target: str) -&gt; None
 
Represents a canonical name (alias) record.
 
  Methods defined here:
__eq__(self, other) from CNAMERecord
__init__(self, target: str) -> None from CNAMERecord
__replace__ = _replace(self, /, **changes) from dataclasses
__repr__(self) from CNAMERecord

Data descriptors defined here:
__dict__
dictionary for instance variables
__weakref__
list of weak references to the object

Data and other attributes defined here:
__dataclass_fields__ = {'target': Field(name='target',type=<class 'str'>,default=<...xy({}),kw_only=False,doc=None,_field_type=_FIELD)}
__dataclass_params__ = _DataclassParams(init=True,repr=True,eq=True,ord...rue,kw_only=False,slots=False,weakref_slot=False)
__hash__ = None
__match_args__ = ('target',)

 
class DNSFlags(builtins.object)
    DNSFlags(
    qr: int = 0,
    opcode: int = 0,
    aa: int = 0,
    tc: int = 0,
    rd: int = 1,
    ra: int = 0,
    z: int = 0,
    rcode: int = 0
) -&gt; None
 
Represents DNS header flags and provides serialization utilities.
 
  Methods defined here:
__eq__(self, other) from DNSFlags
__init__( self, qr: int = 0, opcode: int = 0, aa: int = 0, tc: int = 0, rd: int = 1, ra: int = 0, z: int = 0, rcode: int = 0 ) -> None from DNSFlags
__replace__ = _replace(self, /, **changes) from dataclasses
__repr__(self) from DNSFlags
to_int(self) -> int
Serialize the DNS flags into a 16-bit integer according to RFC 1035.

Class methods defined here:
from_int(value: int) -> DNSFlags
Deserialize a 16-bit integer into a DNSFlags instance.

Data descriptors defined here:
__dict__
dictionary for instance variables
__weakref__
list of weak references to the object

Data and other attributes defined here:
__dataclass_fields__ = {'aa': Field(name='aa',type=<class 'int'>,default=0,def...xy({}),kw_only=False,doc=None,_field_type=_FIELD), 'opcode': Field(name='opcode',type=<class 'int'>,default=0...xy({}),kw_only=False,doc=None,_field_type=_FIELD), 'qr': Field(name='qr',type=<class 'int'>,default=0,def...xy({}),kw_only=False,doc=None,_field_type=_FIELD), 'ra': Field(name='ra',type=<class 'int'>,default=0,def...xy({}),kw_only=False,doc=None,_field_type=_FIELD), 'rcode': Field(name='rcode',type=<class 'int'>,default=0,...xy({}),kw_only=False,doc=None,_field_type=_FIELD), 'rd': Field(name='rd',type=<class 'int'>,default=1,def...xy({}),kw_only=False,doc=None,_field_type=_FIELD), 'tc': Field(name='tc',type=<class 'int'>,default=0,def...xy({}),kw_only=False,doc=None,_field_type=_FIELD), 'z': Field(name='z',type=<class 'int'>,default=0,defa...xy({}),kw_only=False,doc=None,_field_type=_FIELD)}
__dataclass_params__ = _DataclassParams(init=True,repr=True,eq=True,ord...rue,kw_only=False,slots=False,weakref_slot=False)
__hash__ = None
__match_args__ = ('qr', 'opcode', 'aa', 'tc', 'rd', 'ra', 'z', 'rcode')
aa = 0
opcode = 0
qr = 0
ra = 0
rcode = 0
rd = 1
tc = 0
z = 0

 
class DNSHeader(builtins.object)
    DNSHeader(
    transaction_id: int = 0,
    flags: DNSFlags = &lt;factory&gt;,
    question_count: int = 0,
    answer_count: int = 0,
    authority_count: int = 0,
    additional_count: int = 0
) -&gt; None
 
Represents the DNS message header structure (12 bytes).
 
  Methods defined here:
__eq__(self, other) from DNSHeader
__init__( self, transaction_id: int = 0, flags: DNSFlags = <factory>, question_count: int = 0, answer_count: int = 0, authority_count: int = 0, additional_count: int = 0 ) -> None from DNSHeader
__replace__ = _replace(self, /, **changes) from dataclasses
__repr__(self) from DNSHeader
pack(self) -> bytes
Pack the DNS header into its binary representation.

Class methods defined here:
unpack(data: bytes) -> DNSHeader
Unpack raw bytes into a DNSHeader instance.

Data descriptors defined here:
__dict__
dictionary for instance variables
__weakref__
list of weak references to the object

Data and other attributes defined here:
SIZE = 12
__dataclass_fields__ = {'additional_count': Field(name='additional_count',type=<class 'int'>...xy({}),kw_only=False,doc=None,_field_type=_FIELD), 'answer_count': Field(name='answer_count',type=<class 'int'>,def...xy({}),kw_only=False,doc=None,_field_type=_FIELD), 'authority_count': Field(name='authority_count',type=<class 'int'>,...xy({}),kw_only=False,doc=None,_field_type=_FIELD), 'flags': Field(name='flags',type=<class 'datatypes.DNSFla...xy({}),kw_only=False,doc=None,_field_type=_FIELD), 'question_count': Field(name='question_count',type=<class 'int'>,d...xy({}),kw_only=False,doc=None,_field_type=_FIELD), 'transaction_id': Field(name='transaction_id',type=<class 'int'>,d...xy({}),kw_only=False,doc=None,_field_type=_FIELD)}
__dataclass_params__ = _DataclassParams(init=True,repr=True,eq=True,ord...rue,kw_only=False,slots=False,weakref_slot=False)
__hash__ = None
__match_args__ = ('transaction_id', 'flags', 'question_count', 'answer_count', 'authority_count', 'additional_count')
additional_count = 0
answer_count = 0
authority_count = 0
question_count = 0
transaction_id = 0

 
class DNSMessage(builtins.object)
    DNSMessage(
    header: DNSHeader = &lt;factory&gt;,
    questions: List[DNSQuestion] = &lt;factory&gt;,
    answers: List[DNSResourceRecord] = &lt;factory&gt;,
    authorities: List[DNSResourceRecord] = &lt;factory&gt;,
    additionals: List[DNSResourceRecord] = &lt;factory&gt;
) -&gt; None
 
Represents a full DNS message including all sections.
 
  Methods defined here:
__eq__(self, other) from DNSMessage
__init__( self, header: DNSHeader = <factory>, questions: List[DNSQuestion] = <factory>, answers: List[DNSResourceRecord] = <factory>, authorities: List[DNSResourceRecord] = <factory>, additionals: List[DNSResourceRecord] = <factory> ) -> None from DNSMessage
__replace__ = _replace(self, /, **changes) from dataclasses
__repr__(self) from DNSMessage

Readonly properties defined here:
is_query
Return True if this message is a DNS query.
is_response
Return True if this message is a DNS response.

Data descriptors defined here:
__dict__
dictionary for instance variables
__weakref__
list of weak references to the object

Data and other attributes defined here:
__dataclass_fields__ = {'additionals': Field(name='additionals',type=typing.List[dataty...xy({}),kw_only=False,doc=None,_field_type=_FIELD), 'answers': Field(name='answers',type=typing.List[datatypes....xy({}),kw_only=False,doc=None,_field_type=_FIELD), 'authorities': Field(name='authorities',type=typing.List[dataty...xy({}),kw_only=False,doc=None,_field_type=_FIELD), 'header': Field(name='header',type=<class 'datatypes.DNSHe...xy({}),kw_only=False,doc=None,_field_type=_FIELD), 'questions': Field(name='questions',type=typing.List[datatype...xy({}),kw_only=False,doc=None,_field_type=_FIELD)}
__dataclass_params__ = _DataclassParams(init=True,repr=True,eq=True,ord...rue,kw_only=False,slots=False,weakref_slot=False)
__hash__ = None
__match_args__ = ('header', 'questions', 'answers', 'authorities', 'additionals')

 
class DNSQuestion(builtins.object)
    DNSQuestion(
    name: str,
    qtype: int = &lt;RecordType.A: 1&gt;,
    qclass: int = &lt;RecordClass.IN: 1&gt;
) -&gt; None
 
Represents a DNS question section entry.
 
  Methods defined here:
__eq__(self, other) from DNSQuestion
__init__( self, name: str, qtype: int = <RecordType.A: 1>, qclass: int = <RecordClass.IN: 1> ) -> None from DNSQuestion
__replace__ = _replace(self, /, **changes) from dataclasses
__repr__(self) from DNSQuestion

Data descriptors defined here:
__dict__
dictionary for instance variables
__weakref__
list of weak references to the object

Data and other attributes defined here:
__dataclass_fields__ = {'name': Field(name='name',type=<class 'str'>,default=<da...xy({}),kw_only=False,doc=None,_field_type=_FIELD), 'qclass': Field(name='qclass',type=<class 'int'>,default=<...xy({}),kw_only=False,doc=None,_field_type=_FIELD), 'qtype': Field(name='qtype',type=<class 'int'>,default=<R...xy({}),kw_only=False,doc=None,_field_type=_FIELD)}
__dataclass_params__ = _DataclassParams(init=True,repr=True,eq=True,ord...rue,kw_only=False,slots=False,weakref_slot=False)
__hash__ = None
__match_args__ = ('name', 'qtype', 'qclass')
qclass = <RecordClass.IN: 1>
qtype = <RecordType.A: 1>

 
class DNSResourceRecord(builtins.object)
    DNSResourceRecord(
    name: str,
    rtype: int,
    rclass: int = &lt;RecordClass.IN: 1&gt;,
    ttl: int = 300,
    rdata: Optional[RData] = None
) -&gt; None
 
Represents a generic DNS resource record.
 
  Methods defined here:
__eq__(self, other) from DNSResourceRecord
__init__( self, name: str, rtype: int, rclass: int = <RecordClass.IN: 1>, ttl: int = 300, rdata: Optional[RData] = None ) -> None from DNSResourceRecord
__replace__ = _replace(self, /, **changes) from dataclasses
__repr__(self) from DNSResourceRecord

Data descriptors defined here:
__dict__
dictionary for instance variables
__weakref__
list of weak references to the object

Data and other attributes defined here:
__dataclass_fields__ = {'name': Field(name='name',type=<class 'str'>,default=<da...xy({}),kw_only=False,doc=None,_field_type=_FIELD), 'rclass': Field(name='rclass',type=<class 'int'>,default=<...xy({}),kw_only=False,doc=None,_field_type=_FIELD), 'rdata': Field(name='rdata',type=datatypes.ARecord | data...xy({}),kw_only=False,doc=None,_field_type=_FIELD), 'rtype': Field(name='rtype',type=<class 'int'>,default=<d...xy({}),kw_only=False,doc=None,_field_type=_FIELD), 'ttl': Field(name='ttl',type=<class 'int'>,default=300,...xy({}),kw_only=False,doc=None,_field_type=_FIELD)}
__dataclass_params__ = _DataclassParams(init=True,repr=True,eq=True,ord...rue,kw_only=False,slots=False,weakref_slot=False)
__hash__ = None
__match_args__ = ('name', 'rtype', 'rclass', 'ttl', 'rdata')
rclass = <RecordClass.IN: 1>
rdata = None
ttl = 300

 
class MXRecord(builtins.object)
    MXRecord(preference: int, exchange: str) -&gt; None
 
Represents a mail exchange record with priority.
 
  Methods defined here:
__eq__(self, other) from MXRecord
__init__(self, preference: int, exchange: str) -> None from MXRecord
__replace__ = _replace(self, /, **changes) from dataclasses
__repr__(self) from MXRecord

Data descriptors defined here:
__dict__
dictionary for instance variables
__weakref__
list of weak references to the object

Data and other attributes defined here:
__dataclass_fields__ = {'exchange': Field(name='exchange',type=<class 'str'>,default...xy({}),kw_only=False,doc=None,_field_type=_FIELD), 'preference': Field(name='preference',type=<class 'int'>,defau...xy({}),kw_only=False,doc=None,_field_type=_FIELD)}
__dataclass_params__ = _DataclassParams(init=True,repr=True,eq=True,ord...rue,kw_only=False,slots=False,weakref_slot=False)
__hash__ = None
__match_args__ = ('preference', 'exchange')

 
class NSRecord(builtins.object)
    NSRecord(nameserver: str) -&gt; None
 
Represents an authoritative name server record.
 
  Methods defined here:
__eq__(self, other) from NSRecord
__init__(self, nameserver: str) -> None from NSRecord
__replace__ = _replace(self, /, **changes) from dataclasses
__repr__(self) from NSRecord

Data descriptors defined here:
__dict__
dictionary for instance variables
__weakref__
list of weak references to the object

Data and other attributes defined here:
__dataclass_fields__ = {'nameserver': Field(name='nameserver',type=<class 'str'>,defau...xy({}),kw_only=False,doc=None,_field_type=_FIELD)}
__dataclass_params__ = _DataclassParams(init=True,repr=True,eq=True,ord...rue,kw_only=False,slots=False,weakref_slot=False)
__hash__ = None
__match_args__ = ('nameserver',)

 
class Opcode(enum.IntEnum)
    Opcode(*values)
 
Enumeration of DNS operation codes.
 
 
Method resolution order:
Opcode
enum.IntEnum
builtins.int
enum.ReprEnum
enum.Enum
builtins.object

Methods defined here:
__format__(self, format_spec, /) from builtins.int
Convert to a string according to format_spec.
__new__(cls, value) from enum.Enum
Create and return a new object.  See help(type) for accurate signature.

Data and other attributes defined here:
IQUERY = <Opcode.IQUERY: 1>
QUERY = <Opcode.QUERY: 0>
STATUS = <Opcode.STATUS: 2>

Methods inherited from enum.IntEnum:
__repr__(self) from enum.Enum
Return repr(self).
__str__ = __repr__(self, /) from builtins.int
Return repr(self).

Methods inherited from builtins.int:
__abs__(self, /)
abs(self)
__add__(self, value, /)
Return self+value.
__and__(self, value, /)
Return self&value.
__bool__(self, /)
True if self else False
__ceil__(self, /)
Ceiling of an Integral returns itself.
__divmod__(self, value, /)
Return divmod(self, value).
__eq__(self, value, /)
Return self==value.
__float__(self, /)
float(self)
__floor__(self, /)
Flooring an Integral returns itself.
__floordiv__(self, value, /)
Return self//value.
__ge__(self, value, /)
Return self>=value.
__getnewargs__(self, /)
__gt__(self, value, /)
Return self>value.
__hash__(self, /)
Return hash(self).
__index__(self, /)
Return self converted to an integer, if self is suitable for use as an index into a list.
__int__(self, /)
int(self)
__invert__(self, /)
~self
__le__(self, value, /)
Return self<=value.
__lshift__(self, value, /)
Return self<<value.
__lt__(self, value, /)
Return self<value.
__mod__(self, value, /)
Return self%value.
__mul__(self, value, /)
Return self*value.
__ne__(self, value, /)
Return self!=value.
__neg__(self, /)
-self
__or__(self, value, /)
Return self|value.
__pos__(self, /)
+self
__pow__(self, value, mod=None, /)
Return pow(self, value, mod).
__radd__(self, value, /)
Return value+self.
__rand__(self, value, /)
Return value&self.
__rdivmod__(self, value, /)
Return divmod(value, self).
__rfloordiv__(self, value, /)
Return value//self.
__rlshift__(self, value, /)
Return value<<self.
__rmod__(self, value, /)
Return value%self.
__rmul__(self, value, /)
Return value*self.
__ror__(self, value, /)
Return value|self.
__round__(self, ndigits=None, /)
Rounding an Integral returns itself.
 
Rounding with an ndigits argument also returns an integer.
__rpow__(self, value, mod=None, /)
Return pow(value, self, mod).
__rrshift__(self, value, /)
Return value>>self.
__rshift__(self, value, /)
Return self>>value.
__rsub__(self, value, /)
Return value-self.
__rtruediv__(self, value, /)
Return value/self.
__rxor__(self, value, /)
Return value^self.
__sizeof__(self, /)
Returns size in memory, in bytes.
__sub__(self, value, /)
Return self-value.
__truediv__(self, value, /)
Return self/value.
__trunc__(self, /)
Truncating an Integral returns itself.
__xor__(self, value, /)
Return self^value.
as_integer_ratio(self, /)
Return a pair of integers, whose ratio is equal to the original int.
 
The ratio is in lowest terms and has a positive denominator.
 
>>> (10).as_integer_ratio()
(10, 1)
>>> (-10).as_integer_ratio()
(-10, 1)
>>> (0).as_integer_ratio()
(0, 1)
bit_count(self, /)
Number of ones in the binary representation of the absolute value of self.
 
Also known as the population count.
 
>>> bin(13)
'0b1101'
>>> (13).bit_count()
3
bit_length(self, /)
Number of bits necessary to represent self in binary.
 
>>> bin(37)
'0b100101'
>>> (37).bit_length()
6
conjugate(self, /)
Returns self, the complex conjugate of any int.
is_integer(self, /)
Returns True. Exists for duck type compatibility with float.is_integer.
to_bytes(self, /, length=1, byteorder='big', *, signed=False)
Return an array of bytes representing an integer.
 
length
  Length of bytes object to use.  An OverflowError is raised if the
  integer is not representable with the given number of bytes.  Default
  is length 1.
byteorder
  The byte order used to represent the integer.  If byteorder is 'big',
  the most significant byte is at the beginning of the byte array.  If
  byteorder is 'little', the most significant byte is at the end of the
  byte array.  To request the native byte order of the host system, use
  sys.byteorder as the byte order value.  Default is to use 'big'.
signed
  Determines whether two's complement is used to represent the integer.
  If signed is False and a negative integer is given, an OverflowError
  is raised.

Class methods inherited from builtins.int:
from_bytes(bytes, byteorder='big', *, signed=False)
Return the integer represented by the given array of bytes.
 
bytes
  Holds the array of bytes to convert.  The argument must either
  support the buffer protocol or be an iterable object producing bytes.
  Bytes and bytearray are examples of built-in objects that support the
  buffer protocol.
byteorder
  The byte order used to represent the integer.  If byteorder is 'big',
  the most significant byte is at the beginning of the byte array.  If
  byteorder is 'little', the most significant byte is at the end of the
  byte array.  To request the native byte order of the host system, use
  sys.byteorder as the byte order value.  Default is to use 'big'.
signed
  Indicates whether two's complement is used to represent the integer.

Data descriptors inherited from builtins.int:
denominator
the denominator of a rational number in lowest terms
imag
the imaginary part of a complex number
numerator
the numerator of a rational number in lowest terms
real
the real part of a complex number

Methods inherited from enum.Enum:
__dir__(self)
Returns public methods and other interesting attributes.
__reduce_ex__(self, proto)
Helper for pickle.

Data descriptors inherited from enum.Enum:
name
The name of the Enum member.
value
The value of the Enum member.

Static methods inherited from enum.EnumType:
__contains__(value)
Return True if `value` is in `cls`.
 
`value` is in `cls` if:
1) `value` is a member of `cls`, or
2) `value` is the value of one of the `cls`'s members.
3) `value` is a pseudo-member (flags)
__getitem__(name)
Return the member matching `name`.
__iter__()
Return members in definition order.
__len__()
Return the number of members (no aliases)

Readonly properties inherited from enum.EnumType:
__members__
Returns a mapping of member name->value.
 
This mapping lists all enum members, including aliases. Note that this
is a read-only view of the internal mapping.

 
class PTRRecord(builtins.object)
    PTRRecord(ptrdname: str) -&gt; None
 
Represents a reverse DNS pointer record.
 
  Methods defined here:
__eq__(self, other) from PTRRecord
__init__(self, ptrdname: str) -> None from PTRRecord
__replace__ = _replace(self, /, **changes) from dataclasses
__repr__(self) from PTRRecord

Data descriptors defined here:
__dict__
dictionary for instance variables
__weakref__
list of weak references to the object

Data and other attributes defined here:
__dataclass_fields__ = {'ptrdname': Field(name='ptrdname',type=<class 'str'>,default...xy({}),kw_only=False,doc=None,_field_type=_FIELD)}
__dataclass_params__ = _DataclassParams(init=True,repr=True,eq=True,ord...rue,kw_only=False,slots=False,weakref_slot=False)
__hash__ = None
__match_args__ = ('ptrdname',)

 
class RecordClass(enum.IntEnum)
    RecordClass(*values)
 
Enumeration of DNS record classes.
 
 
Method resolution order:
RecordClass
enum.IntEnum
builtins.int
enum.ReprEnum
enum.Enum
builtins.object

Methods defined here:
__format__(self, format_spec, /) from builtins.int
Convert to a string according to format_spec.
__new__(cls, value) from enum.Enum
Create and return a new object.  See help(type) for accurate signature.

Data and other attributes defined here:
ANY = <RecordClass.ANY: 255>
IN = <RecordClass.IN: 1>

Methods inherited from enum.IntEnum:
__repr__(self) from enum.Enum
Return repr(self).
__str__ = __repr__(self, /) from builtins.int
Return repr(self).

Methods inherited from builtins.int:
__abs__(self, /)
abs(self)
__add__(self, value, /)
Return self+value.
__and__(self, value, /)
Return self&value.
__bool__(self, /)
True if self else False
__ceil__(self, /)
Ceiling of an Integral returns itself.
__divmod__(self, value, /)
Return divmod(self, value).
__eq__(self, value, /)
Return self==value.
__float__(self, /)
float(self)
__floor__(self, /)
Flooring an Integral returns itself.
__floordiv__(self, value, /)
Return self//value.
__ge__(self, value, /)
Return self>=value.
__getnewargs__(self, /)
__gt__(self, value, /)
Return self>value.
__hash__(self, /)
Return hash(self).
__index__(self, /)
Return self converted to an integer, if self is suitable for use as an index into a list.
__int__(self, /)
int(self)
__invert__(self, /)
~self
__le__(self, value, /)
Return self<=value.
__lshift__(self, value, /)
Return self<<value.
__lt__(self, value, /)
Return self<value.
__mod__(self, value, /)
Return self%value.
__mul__(self, value, /)
Return self*value.
__ne__(self, value, /)
Return self!=value.
__neg__(self, /)
-self
__or__(self, value, /)
Return self|value.
__pos__(self, /)
+self
__pow__(self, value, mod=None, /)
Return pow(self, value, mod).
__radd__(self, value, /)
Return value+self.
__rand__(self, value, /)
Return value&self.
__rdivmod__(self, value, /)
Return divmod(value, self).
__rfloordiv__(self, value, /)
Return value//self.
__rlshift__(self, value, /)
Return value<<self.
__rmod__(self, value, /)
Return value%self.
__rmul__(self, value, /)
Return value*self.
__ror__(self, value, /)
Return value|self.
__round__(self, ndigits=None, /)
Rounding an Integral returns itself.
 
Rounding with an ndigits argument also returns an integer.
__rpow__(self, value, mod=None, /)
Return pow(value, self, mod).
__rrshift__(self, value, /)
Return value>>self.
__rshift__(self, value, /)
Return self>>value.
__rsub__(self, value, /)
Return value-self.
__rtruediv__(self, value, /)
Return value/self.
__rxor__(self, value, /)
Return value^self.
__sizeof__(self, /)
Returns size in memory, in bytes.
__sub__(self, value, /)
Return self-value.
__truediv__(self, value, /)
Return self/value.
__trunc__(self, /)
Truncating an Integral returns itself.
__xor__(self, value, /)
Return self^value.
as_integer_ratio(self, /)
Return a pair of integers, whose ratio is equal to the original int.
 
The ratio is in lowest terms and has a positive denominator.
 
>>> (10).as_integer_ratio()
(10, 1)
>>> (-10).as_integer_ratio()
(-10, 1)
>>> (0).as_integer_ratio()
(0, 1)
bit_count(self, /)
Number of ones in the binary representation of the absolute value of self.
 
Also known as the population count.
 
>>> bin(13)
'0b1101'
>>> (13).bit_count()
3
bit_length(self, /)
Number of bits necessary to represent self in binary.
 
>>> bin(37)
'0b100101'
>>> (37).bit_length()
6
conjugate(self, /)
Returns self, the complex conjugate of any int.
is_integer(self, /)
Returns True. Exists for duck type compatibility with float.is_integer.
to_bytes(self, /, length=1, byteorder='big', *, signed=False)
Return an array of bytes representing an integer.
 
length
  Length of bytes object to use.  An OverflowError is raised if the
  integer is not representable with the given number of bytes.  Default
  is length 1.
byteorder
  The byte order used to represent the integer.  If byteorder is 'big',
  the most significant byte is at the beginning of the byte array.  If
  byteorder is 'little', the most significant byte is at the end of the
  byte array.  To request the native byte order of the host system, use
  sys.byteorder as the byte order value.  Default is to use 'big'.
signed
  Determines whether two's complement is used to represent the integer.
  If signed is False and a negative integer is given, an OverflowError
  is raised.

Class methods inherited from builtins.int:
from_bytes(bytes, byteorder='big', *, signed=False)
Return the integer represented by the given array of bytes.
 
bytes
  Holds the array of bytes to convert.  The argument must either
  support the buffer protocol or be an iterable object producing bytes.
  Bytes and bytearray are examples of built-in objects that support the
  buffer protocol.
byteorder
  The byte order used to represent the integer.  If byteorder is 'big',
  the most significant byte is at the beginning of the byte array.  If
  byteorder is 'little', the most significant byte is at the end of the
  byte array.  To request the native byte order of the host system, use
  sys.byteorder as the byte order value.  Default is to use 'big'.
signed
  Indicates whether two's complement is used to represent the integer.

Data descriptors inherited from builtins.int:
denominator
the denominator of a rational number in lowest terms
imag
the imaginary part of a complex number
numerator
the numerator of a rational number in lowest terms
real
the real part of a complex number

Methods inherited from enum.Enum:
__dir__(self)
Returns public methods and other interesting attributes.
__reduce_ex__(self, proto)
Helper for pickle.

Data descriptors inherited from enum.Enum:
name
The name of the Enum member.
value
The value of the Enum member.

Static methods inherited from enum.EnumType:
__contains__(value)
Return True if `value` is in `cls`.
 
`value` is in `cls` if:
1) `value` is a member of `cls`, or
2) `value` is the value of one of the `cls`'s members.
3) `value` is a pseudo-member (flags)
__getitem__(name)
Return the member matching `name`.
__iter__()
Return members in definition order.
__len__()
Return the number of members (no aliases)

Readonly properties inherited from enum.EnumType:
__members__
Returns a mapping of member name->value.
 
This mapping lists all enum members, including aliases. Note that this
is a read-only view of the internal mapping.

 
class RecordType(enum.IntEnum)
    RecordType(*values)
 
Enumeration of DNS record types as defined in multiple RFCs.
 
 
Method resolution order:
RecordType
enum.IntEnum
builtins.int
enum.ReprEnum
enum.Enum
builtins.object

Methods defined here:
__format__(self, format_spec, /) from builtins.int
Convert to a string according to format_spec.
__new__(cls, value) from enum.Enum
Create and return a new object.  See help(type) for accurate signature.

Data and other attributes defined here:
A = <RecordType.A: 1>
AAAA = <RecordType.AAAA: 28>
ANY = <RecordType.ANY: 255>
CAA = <RecordType.CAA: 257>
CNAME = <RecordType.CNAME: 5>
MX = <RecordType.MX: 15>
NS = <RecordType.NS: 2>
PTR = <RecordType.PTR: 12>
SOA = <RecordType.SOA: 6>
SRV = <RecordType.SRV: 33>
TXT = <RecordType.TXT: 16>

Methods inherited from enum.IntEnum:
__repr__(self) from enum.Enum
Return repr(self).
__str__ = __repr__(self, /) from builtins.int
Return repr(self).

Methods inherited from builtins.int:
__abs__(self, /)
abs(self)
__add__(self, value, /)
Return self+value.
__and__(self, value, /)
Return self&value.
__bool__(self, /)
True if self else False
__ceil__(self, /)
Ceiling of an Integral returns itself.
__divmod__(self, value, /)
Return divmod(self, value).
__eq__(self, value, /)
Return self==value.
__float__(self, /)
float(self)
__floor__(self, /)
Flooring an Integral returns itself.
__floordiv__(self, value, /)
Return self//value.
__ge__(self, value, /)
Return self>=value.
__getnewargs__(self, /)
__gt__(self, value, /)
Return self>value.
__hash__(self, /)
Return hash(self).
__index__(self, /)
Return self converted to an integer, if self is suitable for use as an index into a list.
__int__(self, /)
int(self)
__invert__(self, /)
~self
__le__(self, value, /)
Return self<=value.
__lshift__(self, value, /)
Return self<<value.
__lt__(self, value, /)
Return self<value.
__mod__(self, value, /)
Return self%value.
__mul__(self, value, /)
Return self*value.
__ne__(self, value, /)
Return self!=value.
__neg__(self, /)
-self
__or__(self, value, /)
Return self|value.
__pos__(self, /)
+self
__pow__(self, value, mod=None, /)
Return pow(self, value, mod).
__radd__(self, value, /)
Return value+self.
__rand__(self, value, /)
Return value&self.
__rdivmod__(self, value, /)
Return divmod(value, self).
__rfloordiv__(self, value, /)
Return value//self.
__rlshift__(self, value, /)
Return value<<self.
__rmod__(self, value, /)
Return value%self.
__rmul__(self, value, /)
Return value*self.
__ror__(self, value, /)
Return value|self.
__round__(self, ndigits=None, /)
Rounding an Integral returns itself.
 
Rounding with an ndigits argument also returns an integer.
__rpow__(self, value, mod=None, /)
Return pow(value, self, mod).
__rrshift__(self, value, /)
Return value>>self.
__rshift__(self, value, /)
Return self>>value.
__rsub__(self, value, /)
Return value-self.
__rtruediv__(self, value, /)
Return value/self.
__rxor__(self, value, /)
Return value^self.
__sizeof__(self, /)
Returns size in memory, in bytes.
__sub__(self, value, /)
Return self-value.
__truediv__(self, value, /)
Return self/value.
__trunc__(self, /)
Truncating an Integral returns itself.
__xor__(self, value, /)
Return self^value.
as_integer_ratio(self, /)
Return a pair of integers, whose ratio is equal to the original int.
 
The ratio is in lowest terms and has a positive denominator.
 
>>> (10).as_integer_ratio()
(10, 1)
>>> (-10).as_integer_ratio()
(-10, 1)
>>> (0).as_integer_ratio()
(0, 1)
bit_count(self, /)
Number of ones in the binary representation of the absolute value of self.
 
Also known as the population count.
 
>>> bin(13)
'0b1101'
>>> (13).bit_count()
3
bit_length(self, /)
Number of bits necessary to represent self in binary.
 
>>> bin(37)
'0b100101'
>>> (37).bit_length()
6
conjugate(self, /)
Returns self, the complex conjugate of any int.
is_integer(self, /)
Returns True. Exists for duck type compatibility with float.is_integer.
to_bytes(self, /, length=1, byteorder='big', *, signed=False)
Return an array of bytes representing an integer.
 
length
  Length of bytes object to use.  An OverflowError is raised if the
  integer is not representable with the given number of bytes.  Default
  is length 1.
byteorder
  The byte order used to represent the integer.  If byteorder is 'big',
  the most significant byte is at the beginning of the byte array.  If
  byteorder is 'little', the most significant byte is at the end of the
  byte array.  To request the native byte order of the host system, use
  sys.byteorder as the byte order value.  Default is to use 'big'.
signed
  Determines whether two's complement is used to represent the integer.
  If signed is False and a negative integer is given, an OverflowError
  is raised.

Class methods inherited from builtins.int:
from_bytes(bytes, byteorder='big', *, signed=False)
Return the integer represented by the given array of bytes.
 
bytes
  Holds the array of bytes to convert.  The argument must either
  support the buffer protocol or be an iterable object producing bytes.
  Bytes and bytearray are examples of built-in objects that support the
  buffer protocol.
byteorder
  The byte order used to represent the integer.  If byteorder is 'big',
  the most significant byte is at the beginning of the byte array.  If
  byteorder is 'little', the most significant byte is at the end of the
  byte array.  To request the native byte order of the host system, use
  sys.byteorder as the byte order value.  Default is to use 'big'.
signed
  Indicates whether two's complement is used to represent the integer.

Data descriptors inherited from builtins.int:
denominator
the denominator of a rational number in lowest terms
imag
the imaginary part of a complex number
numerator
the numerator of a rational number in lowest terms
real
the real part of a complex number

Methods inherited from enum.Enum:
__dir__(self)
Returns public methods and other interesting attributes.
__reduce_ex__(self, proto)
Helper for pickle.

Data descriptors inherited from enum.Enum:
name
The name of the Enum member.
value
The value of the Enum member.

Static methods inherited from enum.EnumType:
__contains__(value)
Return True if `value` is in `cls`.
 
`value` is in `cls` if:
1) `value` is a member of `cls`, or
2) `value` is the value of one of the `cls`'s members.
3) `value` is a pseudo-member (flags)
__getitem__(name)
Return the member matching `name`.
__iter__()
Return members in definition order.
__len__()
Return the number of members (no aliases)

Readonly properties inherited from enum.EnumType:
__members__
Returns a mapping of member name->value.
 
This mapping lists all enum members, including aliases. Note that this
is a read-only view of the internal mapping.

 
class ResponseCode(enum.IntEnum)
    ResponseCode(*values)
 
Enumeration of DNS response codes returned in replies.
 
 
Method resolution order:
ResponseCode
enum.IntEnum
builtins.int
enum.ReprEnum
enum.Enum
builtins.object

Methods defined here:
__format__(self, format_spec, /) from builtins.int
Convert to a string according to format_spec.
__new__(cls, value) from enum.Enum
Create and return a new object.  See help(type) for accurate signature.

Data and other attributes defined here:
FORMERR = <ResponseCode.FORMERR: 1>
NOERROR = <ResponseCode.NOERROR: 0>
NOTIMP = <ResponseCode.NOTIMP: 4>
NXDOMAIN = <ResponseCode.NXDOMAIN: 3>
REFUSED = <ResponseCode.REFUSED: 5>
SERVFAIL = <ResponseCode.SERVFAIL: 2>

Methods inherited from enum.IntEnum:
__repr__(self) from enum.Enum
Return repr(self).
__str__ = __repr__(self, /) from builtins.int
Return repr(self).

Methods inherited from builtins.int:
__abs__(self, /)
abs(self)
__add__(self, value, /)
Return self+value.
__and__(self, value, /)
Return self&value.
__bool__(self, /)
True if self else False
__ceil__(self, /)
Ceiling of an Integral returns itself.
__divmod__(self, value, /)
Return divmod(self, value).
__eq__(self, value, /)
Return self==value.
__float__(self, /)
float(self)
__floor__(self, /)
Flooring an Integral returns itself.
__floordiv__(self, value, /)
Return self//value.
__ge__(self, value, /)
Return self>=value.
__getnewargs__(self, /)
__gt__(self, value, /)
Return self>value.
__hash__(self, /)
Return hash(self).
__index__(self, /)
Return self converted to an integer, if self is suitable for use as an index into a list.
__int__(self, /)
int(self)
__invert__(self, /)
~self
__le__(self, value, /)
Return self<=value.
__lshift__(self, value, /)
Return self<<value.
__lt__(self, value, /)
Return self<value.
__mod__(self, value, /)
Return self%value.
__mul__(self, value, /)
Return self*value.
__ne__(self, value, /)
Return self!=value.
__neg__(self, /)
-self
__or__(self, value, /)
Return self|value.
__pos__(self, /)
+self
__pow__(self, value, mod=None, /)
Return pow(self, value, mod).
__radd__(self, value, /)
Return value+self.
__rand__(self, value, /)
Return value&self.
__rdivmod__(self, value, /)
Return divmod(value, self).
__rfloordiv__(self, value, /)
Return value//self.
__rlshift__(self, value, /)
Return value<<self.
__rmod__(self, value, /)
Return value%self.
__rmul__(self, value, /)
Return value*self.
__ror__(self, value, /)
Return value|self.
__round__(self, ndigits=None, /)
Rounding an Integral returns itself.
 
Rounding with an ndigits argument also returns an integer.
__rpow__(self, value, mod=None, /)
Return pow(value, self, mod).
__rrshift__(self, value, /)
Return value>>self.
__rshift__(self, value, /)
Return self>>value.
__rsub__(self, value, /)
Return value-self.
__rtruediv__(self, value, /)
Return value/self.
__rxor__(self, value, /)
Return value^self.
__sizeof__(self, /)
Returns size in memory, in bytes.
__sub__(self, value, /)
Return self-value.
__truediv__(self, value, /)
Return self/value.
__trunc__(self, /)
Truncating an Integral returns itself.
__xor__(self, value, /)
Return self^value.
as_integer_ratio(self, /)
Return a pair of integers, whose ratio is equal to the original int.
 
The ratio is in lowest terms and has a positive denominator.
 
>>> (10).as_integer_ratio()
(10, 1)
>>> (-10).as_integer_ratio()
(-10, 1)
>>> (0).as_integer_ratio()
(0, 1)
bit_count(self, /)
Number of ones in the binary representation of the absolute value of self.
 
Also known as the population count.
 
>>> bin(13)
'0b1101'
>>> (13).bit_count()
3
bit_length(self, /)
Number of bits necessary to represent self in binary.
 
>>> bin(37)
'0b100101'
>>> (37).bit_length()
6
conjugate(self, /)
Returns self, the complex conjugate of any int.
is_integer(self, /)
Returns True. Exists for duck type compatibility with float.is_integer.
to_bytes(self, /, length=1, byteorder='big', *, signed=False)
Return an array of bytes representing an integer.
 
length
  Length of bytes object to use.  An OverflowError is raised if the
  integer is not representable with the given number of bytes.  Default
  is length 1.
byteorder
  The byte order used to represent the integer.  If byteorder is 'big',
  the most significant byte is at the beginning of the byte array.  If
  byteorder is 'little', the most significant byte is at the end of the
  byte array.  To request the native byte order of the host system, use
  sys.byteorder as the byte order value.  Default is to use 'big'.
signed
  Determines whether two's complement is used to represent the integer.
  If signed is False and a negative integer is given, an OverflowError
  is raised.

Class methods inherited from builtins.int:
from_bytes(bytes, byteorder='big', *, signed=False)
Return the integer represented by the given array of bytes.
 
bytes
  Holds the array of bytes to convert.  The argument must either
  support the buffer protocol or be an iterable object producing bytes.
  Bytes and bytearray are examples of built-in objects that support the
  buffer protocol.
byteorder
  The byte order used to represent the integer.  If byteorder is 'big',
  the most significant byte is at the beginning of the byte array.  If
  byteorder is 'little', the most significant byte is at the end of the
  byte array.  To request the native byte order of the host system, use
  sys.byteorder as the byte order value.  Default is to use 'big'.
signed
  Indicates whether two's complement is used to represent the integer.

Data descriptors inherited from builtins.int:
denominator
the denominator of a rational number in lowest terms
imag
the imaginary part of a complex number
numerator
the numerator of a rational number in lowest terms
real
the real part of a complex number

Methods inherited from enum.Enum:
__dir__(self)
Returns public methods and other interesting attributes.
__reduce_ex__(self, proto)
Helper for pickle.

Data descriptors inherited from enum.Enum:
name
The name of the Enum member.
value
The value of the Enum member.

Static methods inherited from enum.EnumType:
__contains__(value)
Return True if `value` is in `cls`.
 
`value` is in `cls` if:
1) `value` is a member of `cls`, or
2) `value` is the value of one of the `cls`'s members.
3) `value` is a pseudo-member (flags)
__getitem__(name)
Return the member matching `name`.
__iter__()
Return members in definition order.
__len__()
Return the number of members (no aliases)

Readonly properties inherited from enum.EnumType:
__members__
Returns a mapping of member name->value.
 
This mapping lists all enum members, including aliases. Note that this
is a read-only view of the internal mapping.

 
class SOARecord(builtins.object)
    SOARecord(
    mname: str,
    rname: str,
    serial: int,
    refresh: int,
    retry: int,
    expire: int,
    minimum: int
) -&gt; None
 
Represents the Start of Authority record.
 
  Methods defined here:
__eq__(self, other) from SOARecord
__init__( self, mname: str, rname: str, serial: int, refresh: int, retry: int, expire: int, minimum: int ) -> None from SOARecord
__replace__ = _replace(self, /, **changes) from dataclasses
__repr__(self) from SOARecord

Data descriptors defined here:
__dict__
dictionary for instance variables
__weakref__
list of weak references to the object

Data and other attributes defined here:
__dataclass_fields__ = {'expire': Field(name='expire',type=<class 'int'>,default=<...xy({}),kw_only=False,doc=None,_field_type=_FIELD), 'minimum': Field(name='minimum',type=<class 'int'>,default=...xy({}),kw_only=False,doc=None,_field_type=_FIELD), 'mname': Field(name='mname',type=<class 'str'>,default=<d...xy({}),kw_only=False,doc=None,_field_type=_FIELD), 'refresh': Field(name='refresh',type=<class 'int'>,default=...xy({}),kw_only=False,doc=None,_field_type=_FIELD), 'retry': Field(name='retry',type=<class 'int'>,default=<d...xy({}),kw_only=False,doc=None,_field_type=_FIELD), 'rname': Field(name='rname',type=<class 'str'>,default=<d...xy({}),kw_only=False,doc=None,_field_type=_FIELD), 'serial': Field(name='serial',type=<class 'int'>,default=<...xy({}),kw_only=False,doc=None,_field_type=_FIELD)}
__dataclass_params__ = _DataclassParams(init=True,repr=True,eq=True,ord...rue,kw_only=False,slots=False,weakref_slot=False)
__hash__ = None
__match_args__ = ('mname', 'rname', 'serial', 'refresh', 'retry', 'expire', 'minimum')

 
class SRVRecord(builtins.object)
    SRVRecord(priority: int, weight: int, port: int, target: str) -&gt; None
 
Represents a service locator record.
 
  Methods defined here:
__eq__(self, other) from SRVRecord
__init__(self, priority: int, weight: int, port: int, target: str) -> None from SRVRecord
__replace__ = _replace(self, /, **changes) from dataclasses
__repr__(self) from SRVRecord

Data descriptors defined here:
__dict__
dictionary for instance variables
__weakref__
list of weak references to the object

Data and other attributes defined here:
__dataclass_fields__ = {'port': Field(name='port',type=<class 'int'>,default=<da...xy({}),kw_only=False,doc=None,_field_type=_FIELD), 'priority': Field(name='priority',type=<class 'int'>,default...xy({}),kw_only=False,doc=None,_field_type=_FIELD), 'target': Field(name='target',type=<class 'str'>,default=<...xy({}),kw_only=False,doc=None,_field_type=_FIELD), 'weight': Field(name='weight',type=<class 'int'>,default=<...xy({}),kw_only=False,doc=None,_field_type=_FIELD)}
__dataclass_params__ = _DataclassParams(init=True,repr=True,eq=True,ord...rue,kw_only=False,slots=False,weakref_slot=False)
__hash__ = None
__match_args__ = ('priority', 'weight', 'port', 'target')

 
class TXTRecord(builtins.object)
    TXTRecord(strings: List[bytes]) -&gt; None
 
Represents a text record containing one or more byte strings.
 
  Methods defined here:
__eq__(self, other) from TXTRecord
__init__(self, strings: List[bytes]) -> None from TXTRecord
__replace__ = _replace(self, /, **changes) from dataclasses
__repr__(self) from TXTRecord

Data descriptors defined here:
__dict__
dictionary for instance variables
__weakref__
list of weak references to the object

Data and other attributes defined here:
__dataclass_fields__ = {'strings': Field(name='strings',type=typing.List[bytes],def...xy({}),kw_only=False,doc=None,_field_type=_FIELD)}
__dataclass_params__ = _DataclassParams(init=True,repr=True,eq=True,ord...rue,kw_only=False,slots=False,weakref_slot=False)
__hash__ = None
__match_args__ = ('strings',)

 
Data
        __all__ = ['RecordType', 'RecordClass', 'Opcode', 'ResponseCode', 'DNSFlags', 'DNSHeader', 'DNSQuestion', 'ARecord', 'AAAARecord', 'CNAMERecord', 'NSRecord', 'PTRRecord', 'MXRecord', 'TXTRecord', 'SRVRecord', 'SOARecord', 'CAARecord', 'DNSResourceRecord', 'DNSMessage']
__author_email__ = 'mauricelambert434@gmail.com'
__copyright__ = '\nPyAsyncDNS Copyright (C) 2025, 2026 Maurice L...ome to redistribute it\nunder certain conditions.\n'
__description__ = '\nThis package implements a basic asynchronous DN...r\nwith a feature to exfiltrate data through DNS.\n'
__license__ = 'GPL-3.0 License'
__maintainer__ = 'Maurice Lambert'
__maintainer_email__ = 'mauricelambert434@gmail.com'
__url__ = 'https://github.com/mauricelambert/PyAsyncDNS'

 
Author
        Maurice Lambert