func (c *Cfg) Conf() (f *Conf, changed bool, err error) {
	c.mu.Lock()
	defer c.mu.Unlock()
	if _, err = c.mfile.File(); err != nil {
		return
	}
	f, changed, err, c.changed = c.cfg, c.changed, nil, false
	return
}
Conf returns a resolv.Conf from Cfg and an indicator of its source file has been changed/modificated
compared to the last invocation of this function or an Error if any.
package resolv
import (
	"bytes"
	"errors"
	"fmt"
	"github.com/cznic/dns"
	"github.com/cznic/fileutil"
	"io/ioutil"
	"net"
	"os"
	"strings"
	"sync"
)
var Sys string
const (
	resolvNDotsCap         = 15
	resolvTimeoutCap       = 30
	resolvAttepmptsCap     = 5
	resolvMaxNS            = 3
	resolvMaxSearch        = 6
	resolvMaxSearchChars   = 256
	resolvMaxSortlistPairs = 10
	resolvNDotsDefault     = 1
	resolvTimeoutDefault   = 5
	resolvAttepmptsDefault = 2
)
type Cfg struct {
	cfg     *Conf
	changed bool
	mfile   *fileutil.GoMFile
	logger  *dns.Logger
	mu      sync.Mutex
}
func NewCfg(fname string, logger *dns.Logger) (c *Cfg, err error) {
	x := &Cfg{cfg: &Conf{}, logger: logger}
	if x.mfile, err = fileutil.NewGoMFile(fname, os.O_RDONLY, 0444, 0); err != nil {
		return
	}
	if err = x.cfg.Load(fname); err != nil {
		return
	}
	x.mfile.SetHandler(func(file *os.File) (err error) {
		if _, err = file.Seek(0, 0); err != nil {
			return
		}
		buf := []byte{}
		if buf, err = ioutil.ReadAll(file); err != nil {
			return
		}
		if err = x.cfg.LoadString(fname, string(buf)); err != nil {
			return
		}
		if logger.Level >= dns.LOG_EVENTS {
			logger.Log("loaded %q", fname)
			if logger.Level >= dns.LOG_DEBUG {
				logger.Log("\n%s", x.cfg)
			}
		}
		x.changed = true
		return
	})
	return x, nil
}
func (c *Cfg) SetChanged() {
	c.mu.Lock()
	defer c.mu.Unlock()
	c.mfile.SetChanged()
}