diff --git a/src/zdns/util.go b/src/zdns/util.go index 477cdd52..28b67e22 100644 --- a/src/zdns/util.go +++ b/src/zdns/util.go @@ -15,7 +15,6 @@ package zdns import ( - "errors" "fmt" "net" "strings" @@ -56,37 +55,6 @@ func nameIsBeneath(name, layer string) (bool, string) { return false, "" } -func nextAuthority(name, layer string) (string, error) { - // We are our own authority for PTRs - // (This is dealt with elsewhere) - if strings.HasSuffix(name, "in-addr.arpa") && layer == "." { - return "in-addr.arpa", nil - } - - idx := strings.LastIndex(name, ".") - if idx < 0 || (idx+1) >= len(name) { - return name, nil - } - if layer == "." { - return name[idx+1:], nil - } - - if !strings.HasSuffix(name, layer) { - return "", errors.New("server did not provide appropriate resolvers to continue recursion") - } - - // Limit the search space to the prefix of the string that isnt layer - idx = strings.LastIndex(name, layer) - 1 - if idx < 0 || (idx+1) >= len(name) { - // Out of bounds. We are our own authority - return name, nil - } - // Find the next step in the layer - idx = strings.LastIndex(name[0:idx], ".") - next := name[idx+1:] - return next, nil -} - func checkGlue(server string, result SingleQueryResult) (SingleQueryResult, Status) { for _, additional := range result.Additional { ans, ok := additional.(Answer)