Skip to content

Unable to connect to an IPv6-only redis server by hostname #2240

@nazar554

Description

@nazar554

I'm unable to connect to a Redis server when hostname only has AAAA record.

image

Probably the issue is around here, since when debugging the Socket gets created as AddressFamily.Internetwork,

if (addressFamily == AddressFamily.Unspecified && endpoint is DnsEndPoint)

It's then crashes inside PhysicalConnection.BeginConnectAsync with

Exception thrown: 'System.Net.Sockets.SocketException' in Pipelines.Sockets.Unofficial.dll
The requested name is valid, but no data of the requested type was found.

There is a workaround, seems that setting ConfigurationOptions.ResolveDns = true forces to use the IPv6 address directly, but this breaks DNS updates.

Environment: .NET 6.0.8 (x64) on both Windows and Linux
StackExchange.Redis 2.6.48

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions