mirror of
https://github.com/coredns/coredns.git
synced 2025-10-27 00:04:15 -04:00
plugin/file: fix local CNAME lookup (#1866)
* plugin/file: fix local CNAME lookup Issue #1864 explains it will, when we serve the child zone as well we should just recursive into ourself (upstream self). Thus relax the IsSubDomain check in file/lookup.go and just query (even if the query will hit a remote server). I've looped over all other plugins that do something similar (CNAME resolving) and they didn't do the IsSubDomain check; therefor I've removed it from *file* as well. Added test in file_upstream_test that shows this failed before but now results in a reply. Fixes #1864 * self does not need to be exported * Fix test We don't know if we had a valid reply. Check this.
This commit is contained in:
@@ -122,12 +122,9 @@ func AAAA(b ServiceBackend, zone string, state request.Request, previousRecords
|
||||
}
|
||||
continue
|
||||
}
|
||||
|
||||
// This means we can not complete the CNAME, try to look else where.
|
||||
target := newRecord.Target
|
||||
if dns.IsSubDomain(zone, target) {
|
||||
// We should already have found it
|
||||
continue
|
||||
}
|
||||
m1, e1 := b.Lookup(state, target, state.QType())
|
||||
if e1 != nil {
|
||||
continue
|
||||
|
||||
Reference in New Issue
Block a user