+ rewrites: support exceptions:
*.host -> IP my.host -> my.host *.my.host -> *.my.host Requests for my.host and *.my.host will be passed to upstream servers, while all other requests for *.host will be answered with a rewritten IP
This commit is contained in:
@@ -43,14 +43,14 @@ func (a rewritesArray) Len() int { return len(a) }
|
||||
func (a rewritesArray) Swap(i, j int) { a[i], a[j] = a[j], a[i] }
|
||||
|
||||
// Priority:
|
||||
// . CNAME > A/AAAA;
|
||||
// . exact > wildcard;
|
||||
// . higher level wildcard > lower level wildcard
|
||||
// . CNAME < A/AAAA;
|
||||
// . exact < wildcard;
|
||||
// . higher level wildcard < lower level wildcard
|
||||
func (a rewritesArray) Less(i, j int) bool {
|
||||
if a[i].Type == dns.TypeCNAME && a[j].Type != dns.TypeCNAME {
|
||||
return false
|
||||
} else if a[i].Type != dns.TypeCNAME && a[j].Type == dns.TypeCNAME {
|
||||
return true
|
||||
} else if a[i].Type != dns.TypeCNAME && a[j].Type == dns.TypeCNAME {
|
||||
return false
|
||||
}
|
||||
|
||||
if isWildcard(a[i].Domain) {
|
||||
|
||||
Reference in New Issue
Block a user