Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

squid ignores default DNS servers #102

Open
denisk176 opened this issue Aug 28, 2021 · 4 comments
Open

squid ignores default DNS servers #102

denisk176 opened this issue Aug 28, 2021 · 4 comments

Comments

@denisk176
Copy link

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
Copy link
Contributor

ra-at-diladele-com commented Aug 28, 2021 via email

@denisk176
Copy link
Author

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
Copy link

Qrox commented Aug 16, 2022

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
Copy link

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants