M dns/handle.go => dns/handle.go +1 -1
@@ 15,7 15,7 @@ func handleDnsRequest(w dns.ResponseWriter, r *dns.Msg) {
switch r.Opcode {
case dns.OpcodeQuery:
- parseQuery(m)
+ parseQuery(m, r)
}
w.WriteMsg(m)
M dns/query.go => dns/query.go +2 -1
@@ 12,11 12,12 @@ import (
"github.com/miekg/dns"
)
-func parseQuery(m *dns.Msg) {
+func parseQuery(m *dns.Msg, r *dns.Msg) {
for _, q := range m.Question {
switch q.Qtype {
case dns.TypeA:
log.Printf("[felu/dns] Query for '%s'", q.Name)
+ m.SetRcode(r, dns.RcodeNameError)
}
}
}
M dns/server.go => dns/server.go +1 -1
@@ 9,7 9,7 @@ package dns
import "github.com/miekg/dns"
func Run(addr string) error {
- dns.HandleFunc(".", handleDnsRequest)
+ dns.HandleFunc("ddns.fuckdns.org.", handleDnsRequest)
server := &dns.Server{
Addr: addr,
M docker-compose.yaml => docker-compose.yaml +2 -0
@@ 14,6 14,8 @@ services:
- felu_data:/var/felu
ports:
- 8080:8080
+ - 8081:8081
+ - 53:53/udp
environment:
TZ: Europe/Helsinki
GIN_MODE: release # or "debug" for debug logs