Skip to content

prashant1k99/dns-resolver

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dns-resolver

A simple implementation of DNS resolver in Golang

Steps:

  • Setup base server that takes in domain name as argument to process remaining things
  • Build Header for the Query Message
  • Send request to a name server and check the response
  • Parse the Response we received from the name server and log it properly
    • Parse Headers
    • Parse Question
    • Parse Answer
  • Handle Authority Record
  • Handle Additional Record
  • Format the complete response in Human Readable
  • Query Root Name server to get the Name server for any domain
  • Query for multiple types of requests such as A, CNAME, AA, MX, etc. records

Usage:

go run cmd/main.go google.com -t A

This resolves the ip address of google.com

To see all the request made and complete dns response, add the verbose flag

go run cmd/main.go google.com -t A -v

About

A simple implementation of DNS resolver in Golang

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages