After some testing it currently seems like the that if a proxy is configured, uptime-kuma is using its own local or defined DNS server even when a proxy is defined instead of using the proxy DNS.
Add option that when a proxy is configured, to also use conduct DNS resolution through this proxy.
@jbrunner not sure if you understood what I was writing... it is not possible to switch.
My point was:
Currently defining a socks will still have the uptime-container resolver try to resolve a domain.
It is not possible to define the socks resolver - which by default the logic should be: IF socks configured THEN use socks resolver.
Example of usage:
Connecting via socks to check certain hostnames on a network only accessible via socks.
You would never be able to resolve any of the hostnames if the uptime-kuma resolver is used.
@rezzorix Maybe I missed your point. I'm new to uptime-kuma and missed the feature to resolve DNS trough socks. The proposed solution works for my HTTP checks as expected.
If you change the default behaviour of the existing "Socks v5" config, you might break existing implementations.
The proposed solution provides an additional option in the UI:
IMO using socks5 does not explicit mean to resolve dns through socks. For example: curl does not resolve DNS trough socks by default:
curl -x socks5://localhost:1008 http://example.com cur -x socks5h://localhost:1008 http://example.com
@jbrunner yes you are right, using socks5 does not explicit resolve dns through socks.
The RFC1928 does not state anything about DNS/resolving at all.
On Wikipedia it states for Socks4 & 5 that
"The server should resolve the domain name and make connection to the destination host if it can."
I have found 21+ year old bugzilla postings where exactly what I described is discussed:
SOCKS5: DNS lookups (host resolving) should occur on proxy, not client side.
If I read these threads right, then consensus is/was what I would have also expected:
That resolving should occur on proxy... but again, thats only 1 source and an old one too.
So agreed, rather than calling it a bug, it is probably better called a feature or specific configuration option that is missing in uptime-kuma.
Would be good if we could define within uptime-kuma that if proxy is used - the resolving also happens on proxy side.
For the how-to..... my coding skills are unfortunately not sufficient to tell
Anyways: According to the implementation of socks-proxy-agent the "socks" protocol defaults to "socks5h".
This makes this issue and my pull request obsolete. Just choose "SOCKS" instead of "SOCKS v5" in the UI and the proxy resolves DNS trough socks.
|Issue Title||Created Date||Updated Date|