plugin/hosts: add wildcard support (#8185)

* plugin/hosts: add wildcard support for owner names

Signed-off-by: youknowforsearch <amirhebrahimzader@gmail.com>

* plugin/hosts: document wildcard owner name support

Signed-off-by: youknowforsearch <amirhebrahimzader@gmail.com>

* plugin/hosts: remove unused lookupStaticHost

Signed-off-by: Amirhossein Ebrahimzade <amirhossein.e@smartech.ir>

---------

Signed-off-by: youknowforsearch <amirhebrahimzader@gmail.com>
Signed-off-by: Amirhossein Ebrahimzade <amirhossein.e@smartech.ir>
Co-authored-by: Amirhossein Ebrahimzade <amirhossein.e@smartech.ir>
This commit is contained in:
Amirhossein Ebrahimzade
2026-06-25 08:38:08 +03:30
committed by GitHub
parent e45ad5f87a
commit 6805f6f8a0
5 changed files with 174 additions and 24 deletions

View File

@@ -136,6 +136,18 @@ var hostsTestCases = []test.Case{
Qname: "fallthrough-example.org.", Qtype: dns.TypeAAAA,
Answer: []dns.RR{}, Rcode: dns.RcodeSuccess,
},
{
Qname: "apps.example.com.", Qtype: dns.TypeA,
Answer: []dns.RR{
test.A("apps.example.com. 3600 IN A 5.6.7.8"),
},
},
{
Qname: "aa.example.com.", Qtype: dns.TypeA,
Answer: []dns.RR{
test.A("aa.example.com. 3600 IN A 1.2.3.4"),
},
},
}
const hostsExample = `
@@ -144,6 +156,8 @@ const hostsExample = `
10.0.0.1 example.org
::FFFF:10.0.0.2 example.com
10.0.0.3 fallthrough-example.org
1.2.3.4 aa.example.com
5.6.7.8 *.apps.example.com
reload 5s
timeout 3600
`