diladele / squid-windows

Squid Proxy built for Microsoft Windows
GNU General Public License v2.0
188 stars 40 forks source link

squid ignores default DNS servers #102

Open denisk176 opened 3 years ago

denisk176 commented 3 years ago

If Squid is operated in networks that only allow special DNS servers that are distributed to the client via DHCP, no connections to websites are established. According to the documentation, squid should also be able to get the DNS servers sent via DHCP. But in this case squid ignores the DNS servers.

The default settings were left in Squid.conf for testing. Result: Squid does not connect to the websites. If now the DNS servers were entered, which were sent via DHCP to the client, websites worked immediately.

ra-at-diladele-com commented 3 years ago

We have no ui for squid for windows, admin must configure the squid.conf himself.

On 28 Aug 2021, at 19:04, denisk176 @.***> wrote:



If Squid is operated in networks that only allow special DNS servers that are distributed to the client via DHCP, no connections to websites are established. According to the documentation, squid should also be able to get the DNS servers sent via DHCP. But in this case squid ignores the DNS servers.

The default settings were left in Squid.conf for testing. Result: Squid does not connect to the websites. If now the DNS servers were entered, which were sent via DHCP to the client, websites worked immediately.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/diladele/squid-windows/issues/102, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AATNHVR2NZE53RGPM2Z44ILT7EJJPANCNFSM5C7JQFLA. Triage notifications on the go with GitHub Mobile for iOShttps://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Androidhttps://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

denisk176 commented 3 years ago

The problem is not the UI. It's that squid doesn't behave as it says in the documentation. It says that squid can pull the DNS servers from the DHCP responses if they are specified there. But it does not do that.

Qrox commented 2 years ago

The documentation at http://www.squid-cache.org/Doc/config/dns_nameservers/ says that:

On Windows platforms, if no value is specified here or in
the /etc/resolv.conf file, the list of DNS name servers are
taken from the Windows registry, both static and dynamic DHCP
configurations are supported.

However, it seems Squid for Windows does not use the system DNS servers even if dns_nameservers is not specified in /etc/squid/squid.conf and /etc/resolv.conf does not exist. Instead it prints these lines to the log:

Warning: Could not find any nameservers. Trying to use localhost
Please check your /etc/resolv.conf file

Judging from the second line, I suspect Squid for Windows might have been compiled without the _SQUID_WINDOWS_ flag, because as shown in these lines of code from the squid repo, if the flag is set the second line should be Please check your TCP-IP settings or /etc/resolv.conf file instead.

https://github.com/squid-cache/squid/blob/4a28fc5546e36182eaf0beea1818f25587d34e3f/src/dns_internal.cc#L1606

The function call for looking up the system DNS registry is also behind the _SQUID_WINDOWS_ flag as seen at these lines, which might explain why Squid for Windows does not use the system DNS servers.

https://github.com/squid-cache/squid/blob/4a28fc5546e36182eaf0beea1818f25587d34e3f/src/dns_internal.cc#L1599

However I'm not familiar with how Squid for Windows is compiled, so this is only my best guess. Hope this helps and this issue is addressed soon!

rawahars commented 1 year ago

@Qrox @denisk176 Given that this doesn't seem to have been fixed in the binaries available at the moment, do we know how can we compile Squid for Windows?

The instructions provided here- https://wiki.squid-cache.org/KnowledgeBase/Windows#compiling are not user friendly and sort of incomplete. I did email the mailing list but haven't heard back yet.