refactor to async tokio with modular architecture
- Replace synchronous std::net::UdpSocket with tokio async runtime - Spawn concurrent task per incoming DNS query via tokio::spawn - Extract monolithic main.rs into modules: buffer, header, question, record, packet, config, cache, forward, stats - Share state across tasks via Arc<ServerCtx> with scoped Mutex locks - Add TOML config loading, TTL-aware cache, structured logging, stats - Add CLAUDE.md, README, dns_fun.toml config, and design docs Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
25
dns_fun.toml
Normal file
25
dns_fun.toml
Normal file
@@ -0,0 +1,25 @@
|
||||
[server]
|
||||
bind_addr = "0.0.0.0:53"
|
||||
|
||||
[upstream]
|
||||
address = "8.8.8.8"
|
||||
port = 53
|
||||
timeout_ms = 3000
|
||||
|
||||
[cache]
|
||||
max_entries = 10000
|
||||
min_ttl = 60
|
||||
max_ttl = 86400
|
||||
|
||||
# Example zone records:
|
||||
# [[zones]]
|
||||
# domain = "dimescu.ro"
|
||||
# record_type = "A"
|
||||
# value = "3.120.139.105"
|
||||
# ttl = 30
|
||||
|
||||
# [[zones]]
|
||||
# domain = "test.local"
|
||||
# record_type = "A"
|
||||
# value = "127.0.0.1"
|
||||
# ttl = 60
|
||||
Reference in New Issue
Block a user