|
| 1 | +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> |
| 2 | +<HTML> |
| 3 | + <HEAD> |
| 4 | + <TITLE> [squid-users] peer-select.cc, cache_peer and dns queries |
| 5 | + </TITLE> |
| 6 | + <LINK REL="Index" HREF="index.html" > |
| 7 | + <LINK REL="made" HREF="mailto:squid-users%40lists.squid-cache.org?Subject=Re%3A%20%5Bsquid-users%5D%20peer-select.cc%2C%20cache_peer%20and%20dns%20queries&In-Reply-To=%3Cbec610c5-9f44-4547-a99b-dfbc38294699%40measurement-factory.com%3E"> |
| 8 | + <META NAME="robots" CONTENT="index,nofollow"> |
| 9 | + <style type="text/css"> |
| 10 | + pre { |
| 11 | + white-space: pre-wrap; /* css-2.1, curent FF, Opera, Safari */ |
| 12 | + } |
| 13 | + </style> |
| 14 | + <META http-equiv="Content-Type" content="text/html; charset=us-ascii"> |
| 15 | + <LINK REL="Previous" HREF="027756.html"> |
| 16 | + <LINK REL="Next" HREF="027740.html"> |
| 17 | + </HEAD> |
| 18 | + <BODY BGCOLOR="#ffffff"> |
| 19 | + <H1>[squid-users] peer-select.cc, cache_peer and dns queries</H1> |
| 20 | + <B>Alex Rousskov</B> |
| 21 | + <A HREF="mailto:squid-users%40lists.squid-cache.org?Subject=Re%3A%20%5Bsquid-users%5D%20peer-select.cc%2C%20cache_peer%20and%20dns%20queries&In-Reply-To=%3Cbec610c5-9f44-4547-a99b-dfbc38294699%40measurement-factory.com%3E" |
| 22 | + TITLE="[squid-users] peer-select.cc, cache_peer and dns queries">rousskov at measurement-factory.com |
| 23 | + </A><BR> |
| 24 | + <I>Tue Jan 13 20:59:05 UTC 2026</I> |
| 25 | + <P><UL> |
| 26 | + <LI>Previous message (by thread): <A HREF="027756.html">[squid-users] peer-select.cc, cache_peer and dns queries |
| 27 | +</A></li> |
| 28 | + <LI>Next message (by thread): <A HREF="027740.html">[squid-users] Squid integration with Netskope forward to proxy |
| 29 | +</A></li> |
| 30 | + <LI> <B>Messages sorted by:</B> |
| 31 | + <a href="date.html#27759">[ date ]</a> |
| 32 | + <a href="thread.html#27759">[ thread ]</a> |
| 33 | + <a href="subject.html#27759">[ subject ]</a> |
| 34 | + <a href="author.html#27759">[ author ]</a> |
| 35 | + </LI> |
| 36 | + </UL> |
| 37 | + <HR> |
| 38 | +<!--beginarticle--> |
| 39 | +<PRE>On 2026-01-13 01:51, archer wrote: |
| 40 | + |
| 41 | +><i> Please check full log at ... |
| 42 | +</I> |
| 43 | +Thank you for sharing that log. |
| 44 | + |
| 45 | + |
| 46 | +><i> In this attempt, I tried to visit google. |
| 47 | +</I> |
| 48 | +The first corresponding DNS lookup is triggered by Squid NetDB feature. |
| 49 | +To disable that feature, ./configure Squid with `--disable-icmp`. |
| 50 | + |
| 51 | +AFAICT, there is no squid.conf option that would disable those lookups |
| 52 | +in Squids built with `--enable-icmp` (which is also the default). |
| 53 | + |
| 54 | + |
| 55 | +HTH, |
| 56 | + |
| 57 | +Alex. |
| 58 | + |
| 59 | + |
| 60 | +>><i> On Jan 13, 2026, at 9:48 AM, Alex Rousskov wrote: |
| 61 | +</I>>><i> |
| 62 | +</I>>><i> On 2026-01-12 20:22, Archer wrote: |
| 63 | +</I>>><i> |
| 64 | +</I>>>><i> I picked up this part of log as  evidence that Squid does conduct DNS |
| 65 | +</I>>>><i> lookups AFTER a peer connection is selected( log ommited). In the |
| 66 | +</I>>>><i> configuration, a cache peer (parent proxy) for specified domains |
| 67 | +</I>>>><i> presents. |
| 68 | +</I>>>><i> And the relative part of config is already provided in some other |
| 69 | +</I>>>><i> thread of this post. TY |
| 70 | +</I>>><i> |
| 71 | +</I>>><i> |
| 72 | +</I>>><i> FWIW, if I have access to a full debugging log collected while |
| 73 | +</I>>><i> reproducing the problem, I may be able to tell you what causes DNS |
| 74 | +</I>>><i> lookups in your specific environment. I discourage Squid admins from |
| 75 | +</I>>><i> studying debugging logs because they are meant for Squid developers |
| 76 | +</I>>><i> and can be very misleading. |
| 77 | +</I>>><i> |
| 78 | +</I>>><i> <A HREF="https://wiki.squid-cache.org/SquidFaq/BugReporting#debugging-a-single-transaction">https://wiki.squid-cache.org/SquidFaq/BugReporting#debugging-a-single-transaction</A> <<A HREF="https://wiki.squid-cache.org/SquidFaq/BugReporting#debugging-a-single-transaction">https://wiki.squid-cache.org/SquidFaq/BugReporting#debugging-a-single-transaction</A>> |
| 79 | +</I>>><i> |
| 80 | +</I>>><i> Without looking at the logs, and without investing a lot of time in |
| 81 | +</I>>><i> trying to reproduce the problem locally based on the partial |
| 82 | +</I>>><i> information you have shared, I can only offer guesses, and I have done |
| 83 | +</I>>><i> that already. |
| 84 | +</I>>><i> |
| 85 | +</I>>><i> Alex. |
| 86 | +</I>>><i> |
| 87 | +</I>>><i> |
| 88 | +</I>>>><i> On 2026-01-09 17:19, archer wrote: |
| 89 | +</I>>>>><i> cache_peer a.b.c.d parent ... name=NodeNG |
| 90 | +</I>>>>><i> always_direct extranet_whitelist |
| 91 | +</I>>>>><i> never_direct extranet |
| 92 | +</I>>>>><i> I observed peer-select.cc still conducting DNS lookups on an |
| 93 | +</I>>>>><i> extranet domain , which is a purely domain-based ACL. e.g. |
| 94 | +</I>>>>><i> |
| 95 | +</I>>>>><i> peer_select.cc(833) selectSomeParent: CONNECT www.example.com |
| 96 | +</I>>>>><i> ... |
| 97 | +</I>>>>><i> peer_select.cc(460) resolveSelected: Find IP destination for: |
| 98 | +</I>>>>><i> www.example.com:443 via a.b.c.d |
| 99 | +</I>>>><i> The above debugging log snippet is unrelated to ACLs checking/code. |
| 100 | +</I>>>><i> Squid says that it needs to resolve a.b.c.d to connect to a peer at |
| 101 | +</I>>>><i> that a.b.c.d address. If a.b.c.d is alerady an IP address, then that |
| 102 | +</I>>>><i> resolution is going to be a no-op -- no actual DNS queries will be sent. |
| 103 | +</I>>>><i> I do not know what triggers other DNS queries in your case. If I have |
| 104 | +</I>>>><i> to guess, I would guess that peer selection algorithm finds multiple |
| 105 | +</I>>>><i> ways to satisfy that CONNECT-to-X request and some of those ways |
| 106 | +</I>>>><i> include a direct connection to X, triggering X resolution. |
| 107 | +</I>>>>><i> So, what can I do to have extranet DNS handled by the parent proxy, |
| 108 | +</I>>>>><i> while leaving the remainder to the child proxy, with a domain list ? |
| 109 | +</I>>>>><i> Squid Cache: Version 5.7 |
| 110 | +</I>>>><i> FWIW, the above version is not supported by the Squid Project. |
| 111 | +</I>>>><i> Alex. |
| 112 | +</I>>><i> |
| 113 | +</I>><i> |
| 114 | +</I> |
| 115 | +</PRE> |
| 116 | + |
| 117 | +<!--endarticle--> |
| 118 | + <HR> |
| 119 | + <P><UL> |
| 120 | + <!--threads--> |
| 121 | + <LI>Previous message (by thread): <A HREF="027756.html">[squid-users] peer-select.cc, cache_peer and dns queries |
| 122 | +</A></li> |
| 123 | + <LI>Next message (by thread): <A HREF="027740.html">[squid-users] Squid integration with Netskope forward to proxy |
| 124 | +</A></li> |
| 125 | + <LI> <B>Messages sorted by:</B> |
| 126 | + <a href="date.html#27759">[ date ]</a> |
| 127 | + <a href="thread.html#27759">[ thread ]</a> |
| 128 | + <a href="subject.html#27759">[ subject ]</a> |
| 129 | + <a href="author.html#27759">[ author ]</a> |
| 130 | + </LI> |
| 131 | + </UL> |
| 132 | + |
| 133 | +<hr> |
| 134 | +<a href="https://lists.squid-cache.org/listinfo/squid-users">More information about the squid-users |
| 135 | +mailing list</a><br> |
| 136 | +</body></html> |
0 commit comments