- New CSV format with port, for example `ip1:port1,ip2:port2` - retrocompatibility with `DNS_ADDRESS`. If set, force upstream type to plain and empty user-picked providers. 127.0.0.1 is now ignored since it's always set to this value internally. - requires `DNS_UPSTREAM_TYPE=plain` must be set to use `DNS_UPSTREAM_PLAIN_ADDRESSES` (unless using retro `DNS_ADDRESS`) - Warning log on using private upstream resolvers updated
27 lines
514 B
Go
27 lines
514 B
Go
package settings
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/qdm12/dns/v2/pkg/provider"
|
|
"github.com/stretchr/testify/require"
|
|
)
|
|
|
|
func Test_defaultDNSProviders(t *testing.T) {
|
|
t.Parallel()
|
|
|
|
names := defaultDNSProviders()
|
|
|
|
found := false
|
|
providers := provider.NewProviders()
|
|
for _, name := range names {
|
|
provider, err := providers.Get(name)
|
|
require.NoError(t, err)
|
|
if len(provider.Plain.IPv4) > 0 {
|
|
found = true
|
|
break
|
|
}
|
|
}
|
|
require.True(t, found, "no default DNS provider has a plaintext IPv4 address")
|
|
}
|