more stuff; insight: use proxy for upstream queries

This commit is contained in:
Miek Gieben 2016-03-21 21:21:29 +00:00
parent ecc5f28671
commit 740178c83f
6 changed files with 156 additions and 97 deletions

View file

@ -4,12 +4,12 @@ import "strings"
type Zones []string
// Matches checks to see if other matches p.
// The match will return the most specific zones
// that matches other. The empty string signals a not found
// Matches checks to see if other matches p. The match will return the most
// specific zones that matches other. The empty string signals a not found
// condition.
func (z Zones) Matches(qname string) string {
zone := ""
// TODO(miek): use IsSubDomain here?
for _, zname := range z {
if strings.HasSuffix(qname, zname) {
if len(zname) > len(zone) {