This project is a DNS server and resolver implemented in the Go programming language. It provides the functionality to act as a DNS server, receiving DNS queries and responding with the appropriate DNS records. Additionally, it can function as a DNS resolver, allowing users to query external DNS servers for DNS records.
- DNS server: Accepts incoming DNS queries and responds with the appropriate DNS records.
- DNS resolver: Sends DNS queries to external DNS servers and receives the corresponding DNS records.
To use this project, you need to have the following installed:
- Go (version 1.19)
- Git
Follow the steps below to get started with the DNS server and resolver:
-
Clone the repository using Git:
git clone https://github.com/Manthan109/dns.git
-
Change to the project directory:
cd dns
-
Run the project:
go run cmd/dns-resolver/main.go
Open a new tab in the terminal and type
dig @127.0.0.1 <url>
example
dig @127.0.0.1 google.com
This is a simple DNS server and resolver that works only on UDP for now and IPv4 addresses (TypeA records). All the other missed out features like caching have been done intentionally to reduce the scope of the project.
- https://amriunix.com/post/deep-dive-into-dns-messages/
- https://www.ques10.com/p/10908/explain-dns-message-format-with-neat-diagram-1/
- https://medium.com/@openmohan/dns-basics-and-building-simple-dns-server-in-go-6cb8e1cfe461
- https://github.com/wardviaene/golang-for-devops-course