packet.application.dns - Man Page

DNS module


Decode DNS layer.

RFC 1035 Domain Names - Implementation and Specification RFC 2671 Extension Mechanisms for DNS (EDNS0) RFC 4034 Resource Records for the DNS Security Extensions RFC 4035 Protocol Modifications for the DNS Security Extensions RFC 4255 Using DNS to Securely Publish Secure Shell (SSH) Key Fingerprints


class DNS(baseobj.BaseObj)

DNS object

    from packet.application.dns import DNS

    # Decode DNS layer
    x = DNS(pktt, proto)

Object definition:

    id          = int,  # Query Identifier
    QR          = int,  # Packet Type (QUERY or REPLY)
    opcode      = int,  # Query Type
    AA          = int,  # Authoritative Answer
    TC          = int,  # Truncated Response
    RD          = int,  # Recursion Desired
    RA          = int,  # Recursion Available
    AD          = int,  # Authentic Data
    CD          = int,  # Checking Disabled
    rcode       = int,  # Response Code
    version     = int,  # Version (EDNS0)
    udpsize     = int,  # UDP Payload Size (EDNS0)
    options     = list, # Options (EDNS0)
    qdcount     = int,  # Number of Queries
    ancount     = int,  # Number of Answers
    nscount     = int,  # Number of Authority Records
    arcount     = int,  # Number of Additional Records
    queries     = list, # List of Queries
    answers     = list, # List of Answers
    authorities = list, # List of Authority Records
    additional  = list, # List of Additional Records

Methods defined here:

__init__(self, pktt, proto)

Initialize object's private data.

    Packet trace object (packet.pktt.Pktt) so this layer has
    access to the parent layers.
    Transport layer protocol.

Truth value testing for the built-in operation bool()

class Option(baseobj.BaseObj)

Option object

class Query(baseobj.BaseObj)

Query object

class Resource(baseobj.BaseObj)

Resource object

class dns_algorithm(packet.utils.Enum)

enum dns_algorithm

class dns_class(packet.utils.Enum)

enum dns_class

class dns_fptype(packet.utils.Enum)

enum dns_fptype

class dns_opcode(packet.utils.Enum)

enum dns_opcode

class dns_query(packet.utils.Enum)

enum dns_query

class dns_rcode(packet.utils.Enum)

enum dns_rcode

class dns_type(packet.utils.Enum)

enum dns_type

See Also

baseobj(3), packet.internet.ipv6addr(3), packet.unpack(3), packet.utils(3)


No known bugs.


Jorge Mora (

Referenced By

packet.transport.tcp(3), packet.transport.udp(3).

14 February 2017 NFStest 2.1.5 dns 1.0