dns-server made in golang
https://github.com/ronitrajfr/dns-server.git
This project implements a simple DNS server in Go, located in app/main.go. It listens for DNS queries over UDP and responds with a hardcoded answer for A record queries (IPv4 address for 127.0.0.1).
Clone the repository:
git clone https://github.com/ronitrajfr/dns-server.git
cd dns-server
go run app/main.go
The server will start and listen for UDP DNS queries on 127.0.0.1:2053.
You can test the server using dig:
dig @127.0.0.1 -p 2053 example.com A
You should receive a response with the IP address 127.0.0.1 for any A record query.
app/main.go: Main server implementation. Handles UDP socket, parses DNS packets, and constructs responses.go.mod: Go module definition.app/main.go to extend functionality (e.g., support more record types, logging, etc.).This project is for educational purposes and is based on the Codecrafters DNS server challenge.