[squid-users] DNS round-robin behaviour

Rob van der Putten rob at sput.nl
Sat Jul 12 08:22:59 UTC 2025


Hi there


On 11/07/2025 14:07, Amos Jeffries wrote:

> pPS, Please start a new thread for each topic.
> 
> On 11/07/25 21:54, paolo.prinx wrote:
>> Hello all,
>>      quick question, how does Squid behave when it receives a DNS 
>> response containing multiple IP addresses? Does it pick a random one 
>> in the list, or does it stick to a certain order?
> 
> The order given by DNS is the order used. Except that when both are 
> available IPv6 are preferred over IPv4.

This does not apply to Squid 5 and higher.
IPv4 addresses get recycled a lot. And with recycling comes the 
reputation of the previous user. Complete with blacklisting and outdated 
GeoIP info. So an IPv4 preference is bad news.
To the Squid maintainers: Please, please, please restore the IPv6 
preference.
A 'quick' DNS based 'fix' here:
http://www.sput.nl/software/squid/squid-prefer-ipv6.html

> 
>>
>> In our config, we have squid pointing to a pool of dnsdist resolvers, 
>> that implement a local packet cache with a 300-second TTL. We are 
>> seeing unbalanced traffic distributions, was wondering if there is 
>> anything we should configure on the Squid side, or if we should 
>> instead look to change the responses returned by the DNS resolver.
>>
>> Any suggestion?
>>
> 
> DNS alone is not sufficient to balance traffic. There are many factors 
> involved including HTTP multiplexing, pipelines, variability of message 
> sizes, and network RTT on each connection.
> 
> The best way to balance traffic is with proper QoS tools. DNS and HTTP 
> proxy are optimized towards service speed - not load redundancy (which 
> actually reduces peak performance).

Regards,
Rob




More information about the squid-users mailing list