aboutsummaryrefslogtreecommitdiff
path: root/plugin/pkg/dnsutil/join.go
diff options
context:
space:
mode:
Diffstat (limited to 'plugin/pkg/dnsutil/join.go')
-rw-r--r--plugin/pkg/dnsutil/join.go8
1 files changed, 3 insertions, 5 deletions
diff --git a/plugin/pkg/dnsutil/join.go b/plugin/pkg/dnsutil/join.go
index 515bf3dad..b3a40db42 100644
--- a/plugin/pkg/dnsutil/join.go
+++ b/plugin/pkg/dnsutil/join.go
@@ -8,12 +8,10 @@ import (
// Join joins labels to form a fully qualified domain name. If the last label is
// the root label it is ignored. Not other syntax checks are performed.
-func Join(labels []string) string {
+func Join(labels ...string) string {
ll := len(labels)
if labels[ll-1] == "." {
- s := strings.Join(labels[:ll-1], ".")
- return dns.Fqdn(s)
+ return strings.Join(labels[:ll-1], ".") + "."
}
- s := strings.Join(labels, ".")
- return dns.Fqdn(s)
+ return dns.Fqdn(strings.Join(labels, "."))
}