func (m *DomainsMux) UpdateContiniously() {
	for {
		err := m.UpdateOnce()
		if err != nil {
			m.logger.Debug(m.logTag, "Failed updating DNS domain handlers: %s", err)
		}
		time.Sleep(30 * time.Second)
	}
}
UpdateContiniously and UpdateOnce are not thread safe
package dns
import (
	"fmt"
	"time"
	"github.com/miekg/dns"
)
type (
	DomainsMapFunc     func() (map[string]IPResolver, error)
	DomainsChangedFunc func()
)
type DomainsMux struct {
	mux *dns.ServeMux
	mapFunc     DomainsMapFunc
	changedFunc DomainsChangedFunc
	prevDomains map[string]struct{}
	logTag string
	logger Logger
}
var _ dns.Handler = &DomainsMux{}
func NewDomainsMux(mux *dns.ServeMux, mapFunc DomainsMapFunc, changedFunc DomainsChangedFunc, logger Logger) *DomainsMux {
	return &DomainsMux{mux, mapFunc, changedFunc, map[string]struct{}{}, "dns.DomainsMux", logger}
}
func (m *DomainsMux) ServeDNS(w dns.ResponseWriter, r *dns.Msg) {
	m.mux.ServeDNS(w, r)
}