func NewServer(config Config) *Server {
	if config.BufferSize <= 0 {
		config.BufferSize = 1220
	}
	if len(config.Zones) == 0 {
		config.Zones = []string{"."}
	}
	if config.Fallback != "" {
		for _, zone := range config.Zones {
			if zone == "." {
				panic(`fallback conflicts with the match all pattern "." (default)`)
			}
		}
	}
	return &Server{
		config: config,
		close:  make(chan struct{}),
	}
}
NewServer creates and returns a new DNS server.
package newdns
import (
	"fmt"
	"net"
	"github.com/miekg/dns"
	"github.com/pkg/errors"
)
type Config struct {
	BufferSize int
	Zones []string
	Handler func(name string) (*Zone, error)
	Fallback string
	Logger Logger
}
type Server struct {
	config Config
	close  chan struct{}
}