aboutsummaryrefslogtreecommitdiff
path: root/plugin/pkg/dnsutil/reverse.go
diff options
context:
space:
mode:
Diffstat (limited to 'plugin/pkg/dnsutil/reverse.go')
-rw-r--r--plugin/pkg/dnsutil/reverse.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/plugin/pkg/dnsutil/reverse.go b/plugin/pkg/dnsutil/reverse.go
index f92cf18b5..a39cf2ed8 100644
--- a/plugin/pkg/dnsutil/reverse.go
+++ b/plugin/pkg/dnsutil/reverse.go
@@ -29,6 +29,11 @@ func ExtractAddressFromReverse(reverseName string) string {
return f(strings.Split(search, "."))
}
+// IsReverse returns true if name is in a reverse zone
+func IsReverse(name string) bool {
+ return strings.HasSuffix(name, v4arpaSuffix) || strings.HasSuffix(name, v6arpaSuffix)
+}
+
func reverse(slice []string) string {
for i := 0; i < len(slice)/2; i++ {
j := len(slice) - i - 1