1
0
Fork
You've already forked echo-dns-server
0
terrible codes for learning rust
  • Rust 44.5%
  • Go 37.5%
  • Makefile 18%
felix wong e86c5e0bf0
go
2026年07月05日 15:00:51 -07:00
go go 2026年07月05日 15:00:51 -07:00
rust go 2026年07月05日 15:00:51 -07:00
.gitignore go 2026年07月05日 15:00:51 -07:00
LICENSE Initial commit 2026年01月14日 23:34:33 +01:00
makefile go 2026年07月05日 15:00:51 -07:00
README.md conflict 2026年01月14日 14:36:02 -08:00

DNS Server

A simple DNS server that responds to DNS queries by returning the requester's IP address.

Description

This DNS server listens on UDP port 5353 and responds to DNS queries with the IP address of the client making the request. It's a minimal implementation that demonstrates basic DNS packet handling.

Building

cargo build --release

Running

cargo run

Or run the release binary:

cargo run --release

The server will listen on 0.0.0.0:5353 (all network interfaces on port 5353).

Testing

You can test the server using dig or nslookup:

dig @127.0.0.1 -p 5353 example.com

The server will respond with your local IP address (127.0.0.1 if querying locally).

Note

Port 5353 is used instead of the standard DNS port 53, which typically requires root/administrator privileges.