net.Dialer calls DialContext for network connection. When the passed address is a domain name. Causes probabilistic connection timeouts

There is no problem with this, because the timeout period you gave is too short, and it may have timed out before some operations were performed.