diff --git a/internal/dnsforward/dnsforward_test.go b/internal/dnsforward/dnsforward_test.go index 995ca5d1..9e4942cc 100644 --- a/internal/dnsforward/dnsforward_test.go +++ b/internal/dnsforward/dnsforward_test.go @@ -583,12 +583,12 @@ func TestSafeSearch(t *testing.T) { cname := testutil.RequireTypeAssert[*dns.CNAME](t, reply.Answer[0]) assert.Equal(t, tc.wantCNAME, cname.Target) - a := testutil.RequireTypeAssert[*dns.A](t, reply.Answer[len(reply.Answer)-1]) + a := testutil.RequireTypeAssert[*dns.A](t, reply.Answer[1]) assert.NotEmpty(t, a.A) } else { require.Len(t, reply.Answer, 1) - a := testutil.RequireTypeAssert[*dns.A](t, reply.Answer[len(reply.Answer)-1]) + a := testutil.RequireTypeAssert[*dns.A](t, reply.Answer[0]) assert.Equal(t, net.IP(tc.want.AsSlice()), a.A) } })