A simple implementation of DNS resolver in Golang
- 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
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