Although not explicitly stated, DNS resolution appears to be taken into consideration as part of the overall http.Client.Timeout setting. If you need to set your own DNS timeout, then it seems https://github.com/miekg/dns is a popular solution.
Also, from what I can tell, it seems although you can configure your own net.Resolver (with allows you to pass a ctx, with a timeout, to its various lookup methods), the irony appears to be that the net.Resolver is only attachable to http.Transport (itself you can only attach that to a custom http.Client) but by the time the http.Transport.DialContext function is called, go has already internally attempted to resolve the hostname given to http.Client.Do and so your instance of the net.Resolver would only really be applicable to any additional DNS lookups required.

Hey @Integralist, great gist! In some cases we can have more than one DNS server, I'd like to know if in that case the code below is right (multiples DNS servers forcing IPV4 resolution):