diff --git a/internal/dnsforward/beforerequest_internal_test.go b/internal/dnsforward/beforerequest_internal_test.go index 832f349269d..7e0d6e9b939 100644 --- a/internal/dnsforward/beforerequest_internal_test.go +++ b/internal/dnsforward/beforerequest_internal_test.go @@ -260,20 +260,16 @@ func TestServer_HandleBefore_udp(t *testing.T) { UDPListenAddrs: []*net.UDPAddr{{}}, TCPListenAddrs: []*net.TCPAddr{{}}, Config: Config{ - UpstreamDNS: []string{localUpsAddr}, - UpstreamMode: UpstreamModeLoadBalance, - EDNSClientSubnet: &EDNSClientSubnet{Enabled: false}, + AllowedClients: tc.allowedClients, + DisallowedClients: tc.disallowedClients, + BlockedHosts: tc.blockedHosts, + UpstreamDNS: []string{localUpsAddr}, + UpstreamMode: UpstreamModeLoadBalance, + EDNSClientSubnet: &EDNSClientSubnet{Enabled: false}, }, ServePlainDNS: true, }) - s.conf.AllowedClients = tc.allowedClients - s.conf.DisallowedClients = tc.disallowedClients - s.conf.BlockedHosts = tc.blockedHosts - - err := s.Prepare(&s.conf) - require.NoError(t, err) - startDeferStop(t, s) client := &dns.Client{