From e3435566879c6a7ed564fc7108a12c0121ecd56c Mon Sep 17 00:00:00 2001 From: Thomas Mangin Date: Mon, 28 Jan 2019 16:36:34 +0000 Subject: plugin/hosts: fix for ipv4-in-ipv6 (#2506) * fix for ipv4-in-ipv6 * update comment as requested --- plugin/hosts/hosts_test.go | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'plugin/hosts/hosts_test.go') diff --git a/plugin/hosts/hosts_test.go b/plugin/hosts/hosts_test.go index 6515f36b9..e412b7ae5 100644 --- a/plugin/hosts/hosts_test.go +++ b/plugin/hosts/hosts_test.go @@ -44,6 +44,12 @@ var hostsTestCases = []test.Case{ test.A("example.org. 3600 IN A 10.0.0.1"), }, }, + { + Qname: "example.com.", Qtype: dns.TypeA, + Answer: []dns.RR{ + test.A("example.com. 3600 IN A 10.0.0.2"), + }, + }, { Qname: "localhost.", Qtype: dns.TypeAAAA, Answer: []dns.RR{ @@ -56,6 +62,12 @@ var hostsTestCases = []test.Case{ test.PTR("1.0.0.10.in-addr.arpa. 3600 PTR example.org."), }, }, + { + Qname: "2.0.0.10.in-addr.arpa.", Qtype: dns.TypePTR, + Answer: []dns.RR{ + test.PTR("2.0.0.10.in-addr.arpa. 3600 PTR example.com."), + }, + }, { Qname: "1.0.0.127.in-addr.arpa.", Qtype: dns.TypePTR, Answer: []dns.RR{ @@ -76,4 +88,6 @@ var hostsTestCases = []test.Case{ const hostsExample = ` 127.0.0.1 localhost localhost.domain ::1 localhost localhost.domain -10.0.0.1 example.org` +10.0.0.1 example.org +::FFFF:10.0.0.2 example.com +` -- cgit v1.2.3