Skip to content

AppajiDheeraj/GoResolve

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GoResolve

CI Release Go Version

 _____ _____ _ / ____| | __ \ | | | | __ ___ | |__) |___ ___ ___ | |_ _____ | | |_ |/ _ \| _ // _ \/ __|/ _ \| \ \ / / _ \ | |__| | (_) | | \ \ __/\__ \ (_) | |\ V / __/ \_____\___/|_| \_\___||___/\___/|_| \_/ \___| GoResolve — DNS Server 

GoResolve is a lightweight, educational DNS server written in Go that demonstrates how DNS works at the wire level. It parses DNS packets manually, supports recursive forwarding, and runs as a UDP server on port 2053.

This project focuses on:

  • Understanding DNS packet structure
  • Working with UDP sockets
  • Implementing a recursive DNS forwarder
  • Writing clean, inspectable Go networking code

✨ Features

  • 🧠 Manual DNS packet parsing (no external DNS libs)
  • 🌐 UDP-based DNS server (0.0.0.0:2053)
  • 🔁 Recursive forwarding to upstream resolvers
  • 🧪 Works on Windows + WSL + Linux
  • 🧾 Structured logs with ASCII startup banner
  • ⚡ Lightweight single-binary design

📷 Example Output

Server Startup

 _____ _____ _ / ____| | __ \ | | | | __ ___ | |__) |___ ___ ___ | |_ _____ | | |_ |/ _ \| _ // _ \/ __|/ _ \| \ \ / / _ \ | |__| | (_) | | \ \ __/\__ \ (_) | |\ V / __/ \_____\___/|_| \_\___||___/\___/|_| \_/ \___| GoResolve — DNS Server ──────────────────────────────────────── Mode : Recursive DNS Listening: 0.0.0.0:2053 Protocol : UDP ──────────────────────────────────────── 

Incoming Query (Server Log)

Received 51 bytes from 172.30.45.134:56015 question #0 {Name:[google com] Type:1 Class:1} forward request for google.com 

Client Side (WSL)

ip route | grep default # -> default via 172.30.32.1 dig @172.30.32.1 -p 2053 google.com
;; ANSWER SECTION: google.com. 60 IN A 142.250.xxx.xxx 

🚀 Getting Started

1️⃣ Build

go build -o goresolve ./app

2️⃣ Run (Recursive Mode)

./goresolve -resolver 8.8.8.8:53

3️⃣ Test (WSL / Linux)

dig @172.30.32.1 -p 2053 google.com

⚠️ Windows nslookup cannot use custom ports. Use WSL + dig instead.


⚙️ Configuration

Flag Description Example
-resolver Upstream DNS server 8.8.8.8:53

If no resolver is provided, GoResolve responds with a default IPv4 address (8.8.8.8).


🧱 Project Structure

GoResolve/ ├── app/ │ └── main.go ├── .github/ │ └── workflows/ │ ├── ci.yml │ └── release.yml ├── go.mod ├── README.md └── LICENSE 

🧠 Learning Goals

This project demonstrates:

  • DNS protocol internals
  • UDP networking in Go
  • Binary packet parsing
  • Recursive DNS resolution
  • WSL ↔ Windows networking
  • Clean CLI-style logging

👨‍💻 Author

Dheeraj Appaji Computer Science Student • Systems & Networking Enthusiast

GitHub: @AppajiDheeraj

About

GoResolve is a minimal, high-performance DNS server written in Go, built to understand how DNS works at a low level. It supports parsing DNS queries, resolving domain names, and responding using standard DNS protocols.

Topics

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages