/*
* Copyright (C) 2024 Jonni Liljamo <jonni@liljamo.com>
*
* This file is licensed under AGPL-3.0-or-later, see NOTICE and LICENSE for
* more information.
*/
// Package dns implements all required DNS functionality for the program.
package dns
import (
"git.src.quest/~liljamo/felu/internal/config"
"github.com/miekg/dns"
)
// Run starts the DNS server.
func Run(addr string, net string) error {
dns.HandleFunc(config.FeluConfig.DNSPattern, handleDNSRequest)
server := &dns.Server{
Addr: addr,
Net: net,
}
return server.ListenAndServe()
}