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

Proxy in k8s: short DNS name not resolved properly #1375

Open
ocervell opened this issue Sep 25, 2023 · 1 comment
Open

Proxy in k8s: short DNS name not resolved properly #1375

ocervell opened this issue Sep 25, 2023 · 1 comment
Labels
Type: Enhancement Most issues will probably ask for additions or changes. Type: Question A query or seeking clarification on parts of the spec. Probably doesn't need the attention of all.

Comments

@ocervell
Copy link

ocervell commented Sep 25, 2023

I am running a Privoxy proxy and a client using httpx within kubernetes, trying to have httpx use that proxy when making requests.

Full DNS name
Running with the full k8s DNS name tor-privoxy.default.svc.cluster.local works:

$ httpx -silent -u https://www.google.com -proxy http://tor-privoxy.default.svc.cluster.local:8118
https://www.google.com [Google Web Server,HSTS,HTTP/3]

Service reduced DNS name
Running with the reduced k8s DNS name tor-privoxy as proxy doesn't seem to work (no results):

$ httpx -silent -u https://www.google.com -json -proxy http://tor-privoxy:8118

Seems like httpx's DNS resolution doesn't work all the way but I'm not getting any error from the output. Name resolution using nslookup does work:

$ nslookup tor-privoxy
Server:         10.96.0.10
Address:        10.96.0.10#53

Name:   tor-privoxy.default.svc.cluster.local
Address: 10.110.18.226

Service IP
Running with the proxy's IP works fine as well:

$ httpx -silent -u https://www.google.com -json -proxy http://10.110.18.226:8118
https://www.google.com [HTTP/3]

The resolv.conf on k8s is like:

cat /etc/resolv.conf 
nameserver 10.96.0.10
search default.svc.cluster.local svc.cluster.local cluster.local mshome.net
options ndots:5

I wasn't sure if the resolvers flag (-r) worked for proxy DNS, but I've tried passing it -r 10.96.0.10 to no effect: are we bypassing default system DNS resolution ?

@ocervell ocervell added the Type: Enhancement Most issues will probably ask for additions or changes. label Sep 25, 2023
@ocervell ocervell changed the title Proxy DNS name not resolved in k8s Proxy in k8s: short DNS name not resolved properly Sep 25, 2023
@Mzack9999
Copy link
Member

@ocervell Apologies for the very late reply. Internally we use fastdialer and by default we parse the content of the hosts file along with retrying with system resolvers on failure. Are you still able to reproduce the issue?

@Mzack9999 Mzack9999 added the Type: Question A query or seeking clarification on parts of the spec. Probably doesn't need the attention of all. label Jun 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Enhancement Most issues will probably ask for additions or changes. Type: Question A query or seeking clarification on parts of the spec. Probably doesn't need the attention of all.
Projects
None yet
Development

No branches or pull requests

2 participants