* Add dnsutil.Join

* Create dnsutil.Join

Create Join helper function and move bits in the code over.
This commit is contained in:
Miek Gieben
2017-08-19 15:22:09 +01:00
committed by GitHub
parent 7c343982a6
commit 02955d7594
8 changed files with 52 additions and 14 deletions

View File

@@ -1,7 +1,7 @@
package file
import (
"strings"
"github.com/coredns/coredns/middleware/pkg/dnsutil"
"github.com/miekg/dns"
)
@@ -14,7 +14,7 @@ func substituteDNAME(qname, owner, target string) string {
labels := dns.SplitDomainName(qname)
labels = append(labels[0:len(labels)-dns.CountLabel(owner)], dns.SplitDomainName(target)...)
return strings.Join(labels, ".") + "."
return dnsutil.Join(labels)
}
return ""