codec (version 1.0.0)
index
codec.py

DNS wire-format encoder and decoder.
 
Handles all record types with full RFC compliance.
Completely decoupled from any socket/transport layer.

 
Classes
       
builtins.object
DNSCodec

 
class DNSCodec(builtins.object)
    Encodes and decodes DNS messages to/from wire format.
Completely transport-agnostic.
 
  Methods defined here:
decode(self, data: bytes) -> DNSMessage
Decode wire-format bytes into a DNSMessage.
encode(self, message: DNSMessage) -> bytes
Encode a complete DNS message to wire-format bytes.

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

 
Functions
       
decode_name(data: bytes, offset: int) -> Tuple[str, int]
Decode a domain name from DNS wire format, supporting pointer compression.
Returns (name, new_offset) where new_offset is just past the name field.
encode_name( name: str, compression: Optional[Dict[str, int]] = None, offset: int = 0 ) -> bytes
Encode a domain name to DNS wire format.
Optionally uses/updates a compression dict (name -> offset in packet).

 
Data
        __all__ = ['encode_name', 'decode_name', 'DNSCodec', 'codec']
__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'
codec = <codec.DNSCodec object>

 
Author
        Maurice Lambert