When a child process makes a DNS query it remains suspended until it receives the response from the DNS server, so with few DNS requests you can have all the children blocked, while they could serve the requests that don't need the DNS.
When all DNS servers are unreachable it waits for a long period: 3 (NAPTR+SRV+A) * [number of DNS servers * number of retransmissions * time to wait per each retransmission] seconds.
With this small patch, if the NAPTR request fails because the DNS server is unreachable the process doesn't try to make the SRV and the A queries . If all the configured DNS servers are unreachable, the delay becames: 1 (instead of 3, only NAPTR) * [numbers of DNS servers * number of retransmissions * time to wait per each retransmission] seconds.
It doesn't give any help to reduce the delay when at least one of the DNS server responds.