Skip to content

(Partial) Python 3 implementation of a DNS message parser (supports A, AAAA and CNAME record types (qtypes) and IPv4/IPv6)

License

Notifications You must be signed in to change notification settings

holzkohlengrill/dns_message_parser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 

Repository files navigation

DNS message parser

(Partial) Python 3 implementation of a DNS message parser (supports A, AAAA and CNAME record types (qtypes) and IPv4/IPv6)

It prompts the user for an input (= binary hex stream; like: a01d81800001000100000000076578616d706c6503636f6d0000010001c00c0001000100001bbc00045db8d822) and would print in the following format:

;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 40989
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;example.com.           IN      A

;; ANSWER SECTION:
example.com.            7100    IN      A       93.184.216.34

The tool returns similar (but less) output to dig.

Extension

In order to add more implementations for Resource Records (QType) add the relevant functions to the _RDataProcessor class and link it in the LUT _qtypeDispatchLUT (LUT for processing function dispatch).

Based on RFCs:

About

(Partial) Python 3 implementation of a DNS message parser (supports A, AAAA and CNAME record types (qtypes) and IPv4/IPv6)

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages