plugin/file: Fix in wrong answers returned when wildcard and concrete records exist (#4599)

* plugin/file: Fix in wrong answers returned when wildcard and concrete records exist

Signed-off-by: Jason Du <xdu@infoblox.com>

* Remove superfluous change

Signed-off-by: Jason Du <xdu@infoblox.com>

* Re-implementation and new test case
If the domain's terminal is neither the matching wildcard, nor a domian directly
under the wildcard, return NXDOMAIN

Signed-off-by: Jason Du <xdu@infoblox.com>

* Fix empty non-terminal & add test case

Signed-off-by: Jason Du <xdu@infoblox.com>

* Cleanup

Signed-off-by: Jason Du <xdu@infoblox.com>

* Fix case on domain name with character before * and add more test cases

Signed-off-by: Jason Du <xdu@infoblox.com>

* Use different IPs for records in cornerCasesWildcard zone file

Signed-off-by: Jason Du <xdu@infoblox.com>
This commit is contained in:
Jason Du 2021-05-17 13:21:08 -07:00 committed by GitHub
parent 5f41d8eb1f
commit fbf3f07f46
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 110 additions and 6 deletions

View file

@ -95,6 +95,12 @@ var dnsTestCases = []test.Case{
},
Ns: miekAuth,
},
{
Qname: "ent.miek.nl.", Qtype: dns.TypeA,
Ns: []dns.RR{
test.SOA("miek.nl. 1800 IN SOA linode.atoom.net. miek.miek.nl. 1282630057 14400 3600 604800 14400"),
},
},
}
const (
@ -193,4 +199,6 @@ www IN CNAME a
archive IN CNAME a
srv IN SRV 10 10 8080 a.miek.nl.
mx IN MX 10 a.miek.nl.`
mx IN MX 10 a.miek.nl.
test.ent IN A 139.162.196.79`