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
lookup_srv resolvers configuration is still using systems resolv.conf #3801
Comments
That's because the resolver is specifically for the http transport dialer. The SRV dialer uses The transports and upstreams are separate from eachother, the chosen upstreams are passed through the transport. There would probably need to be a separate resolver config for upstreams, but that seems annoying to configure. /cc @mohammed90 |
But its there a way for me to not log those in stderr? |
Not really. You'll need to filter the logs out yourself with some other tool. Pipe the Caddy logs through |
Ok, I think these errors are related to Regarding the logs, there's no way we can pipe this out to jq with our current stack without a major restructuring. |
@mohammed90 I think what we should do is move the Resolver config up to the reverse_proxy handler instead, then push it down to the transport on provision (try to type assert for |
Bit more insight on this issue... I logged in all my 3 nodes and manually edited my I have no reports of normal requests failing at all and I can't see any issues in my |
I think we can use this issue to have the resolvers set for both |
Is the lookup_srv resolvers still a problem? Do we need to keep the issue open, and if so, what's the current status? Sorry, it looks like this issue diverged into two separate things. It looks like #3816 addresses it? |
Hey @mholt... so, I think this issue is still valid since @francislavoie already confirmed that the custom resolver is only being applied to the http transport dialer, not the LookupSRV. IMO, both |
Another user has encountered this issue: https://caddy.community/t/dns-server-to-use/14054 |
At a glance, yes, that's one way. Another way I see is to inject the resolver form the Transport into the Upstreams. See, the Transport is provisioned starting in line 206: caddy/modules/caddyhttp/reverseproxy/reverseproxy.go Lines 206 to 220 in 3385856
while Upstreams are provisioned starting in line 246: caddy/modules/caddyhttp/reverseproxy/reverseproxy.go Lines 246 to 278 in 3385856
So we can grab the resolver from the transport and inject it into the Upstream instance. It's been more than a year since I touched this code, so take my judgement with a grain of salt. |
@mohammed90 Maybe we can look into integrating this into #4470. |
I think @francislavoie just added this to #4470, if you want to try it out! |
@danlsgiga Do you still need this? Any chance you could try out that branch? 😀 |
Merged in #4470. Closing this due to completion + inactivity. |
Caddy version:
v2.2.1
The feature introduced in #3479 is not using the specified
addresses
for upstream DNS resolution.Here are is an error log that is occurring every minute in my setup:
The
169.254.169.253
IP is only present in my /etc/resolv.conf and should never be used after I have specified theresolvers
in thetransport
config.My config:
The
dial
call fails to169.254.169.253
because that DNS will fail to resolve any.service.consul
query.The text was updated successfully, but these errors were encountered: