mirror of
https://github.com/coredns/coredns.git
synced 2025-11-01 18:53:43 -04:00
Dns.join (#944)
* Add dnsutil.Join * Create dnsutil.Join Create Join helper function and move bits in the code over.
This commit is contained in:
@@ -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 ""
|
||||
|
||||
Reference in New Issue
Block a user