M cmd/felu/main.go => cmd/felu/main.go +6 -2
@@ 77,9 77,13 @@ func main() {
dnsIP := config.FeluConfig.DNSBindIP
dnsPort := strconv.Itoa(int(config.FeluConfig.DNSBindPort))
dnsAddr := dnsIP + ":" + dnsPort
- slog.Info("Serving DNS", slog.String("addr", dnsAddr))
+ slog.Info("Serving DNS (udp)", slog.String("addr", dnsAddr))
g.Go(func() error {
- return dns.Run(dnsAddr)
+ return dns.Run(dnsAddr, "udp")
+ })
+ slog.Info("Serving DNS (tcp)", slog.String("addr", dnsAddr))
+ g.Go(func() error {
+ return dns.Run(dnsAddr, "tcp")
})
if err := g.Wait(); err != nil {
M internal/dns/server.go => internal/dns/server.go +2 -2
@@ 14,12 14,12 @@ import (
)
// Run starts the DNS server.
-func Run(addr string) error {
+func Run(addr string, net string) error {
dns.HandleFunc(config.FeluConfig.DNSPattern, handleDNSRequest)
server := &dns.Server{
Addr: addr,
- Net: "udp",
+ Net: net,
}
return server.ListenAndServe()