Skip to content

net: Dial always query DNS for both A and AAAA even if network is tcp4 or tcp6 when pure Go resolver is used #45024

Closed
@zhangboyang

Description

@zhangboyang

When pure Go resolver is used, net.Dial always send two DNS query (one for A record and another for AAAA), even if the network parameter set to one of tcp4, tcp6, udp4, udp6. This will add extra latencies when making IPv4-only or IPv6-only connections. In the worst case, for example, a pure IPv4 host with firewall filtered out all AAAA queries, a dial with tcp4 will have to wait 10 second until AAAA query timed out.

The same problem was also found in cgo resolver (#25947), and it was fixed in c659be4.

My pull request will fix this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions