mirror of
https://github.com/coredns/coredns.git
synced 2025-10-28 00:34:24 -04:00
Allow rewriting of the the name of the query as well. And improve
the docs a little.
This commit is contained in:
@@ -1,6 +1,10 @@
|
||||
package middleware
|
||||
|
||||
import "strings"
|
||||
import (
|
||||
"strings"
|
||||
|
||||
"github.com/miekg/dns"
|
||||
)
|
||||
|
||||
// Name represents a domain name.
|
||||
type Name string
|
||||
@@ -13,3 +17,8 @@ type Name string
|
||||
func (n Name) Matches(other string) bool {
|
||||
return strings.HasSuffix(string(n), other)
|
||||
}
|
||||
|
||||
// Normalize lowercases and makes n fully qualified.
|
||||
func (n Name) Normalize() string {
|
||||
return strings.ToLower(dns.Fqdn(string(n)))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user