DNS(3)

πŸ’– DNS(3) πŸ’–

okay bestie, so this is the manual page for packet.application.dns, from the dns 1.0 manual. pull up a chair, grab a boba, we're decoding DNS layers together 🫢


✨ NAME ✨

packet.application.dns β€” it's the DNS module, bestie. that's the whole name, no notes πŸ’…


🌸 DESCRIPTION 🌸

it decodes the DNS layer. that's it, that's the job, and it ate πŸ”₯

and because DNS doesn't exist in a vacuum, here's the lore β€” the RFCs this thing is vibing with:

  • 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

iykyk, the RFC list is the syllabus and we are studying πŸ“šβœ¨


πŸ‘‘ CLASSES πŸ‘‘

πŸ¦‹ class DNS(baseobj.BaseObj)

the DNS object, main character energy fr fr.

Usage:

from packet.application.dns import DNS

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

Object definition:

DNS(
    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
)
no cap, every single one of those fields matters, don't skip a single one πŸ’€

Methods defined here:


__bool__(self)

truth value testing for the built-in operation bool(). so you can literally just go if x: and the vibe check happens automatically ✨

__init__(self, pktt, proto)

the constructor πŸŽ€

it initializes the object's private data. the deets:

  • pktt: packet trace object (packet.pktt.Pktt) so this layer has access to the parent layers. it needs to know its ancestors, periodt.
  • proto: transport layer protocol.

πŸ’œ class Option(baseobj.BaseObj)

the Option object 🌸

πŸ’œ class Query(baseobj.BaseObj)

the Query object 🌸

πŸ’œ class Resource(baseobj.BaseObj)

the 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 πŸ”

go read these next, bestie, they're the friend group:


πŸ’€ BUGS πŸ’€

No known bugs. flawless, unbothered, moisturized, in her lane πŸ‘‘


🫢 AUTHOR 🫢

Jorge Mora (mora@netapp.com) β€” thank you for your service, king πŸŽ€


and that's a wrap on the dns 1.0 manual page, page DNS(3), brought to you by NFStest 3.2, dated 21 March 2023. slay, stay decoded, and don't forget to close your sockets πŸ’–βœ¨πŸ¦‹