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

Specify DNS resolver host:port when running tunnel #1229

Open
ikhwanperwira opened this issue Apr 8, 2024 · 1 comment
Open

Specify DNS resolver host:port when running tunnel #1229

ikhwanperwira opened this issue Apr 8, 2024 · 1 comment
Labels
Priority: Normal Minor issue impacting one or more users Type: Feature Request A big idea that would be split into smaller pieces

Comments

@ikhwanperwira
Copy link

ikhwanperwira commented Apr 8, 2024

Describe the feature you'd like
I expect there is --dns-resolver flag.

cloudflared --dns-resolver=127.0.0.1:10053 tunnel --hello-world

Describe alternatives you've considered
There is, but it's too overhead which I need to run the cloudflared binary in an emulator such as QEMU where I forward port traffic from port 53 in guest to the port 10053 in host.

Additional context
I noticed that, the binary program especially linux based was trying to read local DNS resolver which is [::1]:53. But, there is no local DNS resolver in Android (arm64). I have no root access in my phone to create local DNS server in port 53 as we know port range (0-1024) is reserved and only root access can listen it while I don't have root access. I expect the cloudflared is more user-space friendly instead of kernel-space access permision.

Here is as you see that I have error in this log which it tried to read port 53.

~/cf $ ./cloudflared-linux-arm64 --edge-bind-address=198.41.200.63 tunnel --hello-world
2024-04-08T06:25:57Z INF Thank you for trying Cloudflare Tunnel. Doing so, without a Cloudflare account, is a quick way to experiment and try it out. However, be aware that these account-less Tunnels have no uptime guarantee. If you intend to use Tunnels in production you should use a pre-created named tunnel by following: https://developers.cloudflare.com/cloudflare-one/connections/connect-apps
2024-04-08T06:25:57Z INF Requesting new quick Tunnel on trycloudflare.com...
failed to request quick Tunnel: Post "https://api.trycloudflare.com/tunnel": dial tcp: lookup api.trycloudflare.com on [::1]:53: read udp [::1]:43308->[::1]:53: read: connection refused

I also thought bound specific edge address would resolve this issue, but yet it still need DNS resolver on port 53.

Therefore I expect I can just do this (add --dns-resolver flag)

 ./cloudflared-linux-arm64 --dns-resolver=127.0.0.1:10053 tunnel --hello-world

Therefore I can setup my DNS server in user-space port which is 10053 instead of kernel-space port that requires root previlege (port 53).

@ikhwanperwira ikhwanperwira added Priority: Normal Minor issue impacting one or more users Type: Feature Request A big idea that would be split into smaller pieces labels Apr 8, 2024
@divyam234
Copy link

divyam234 commented May 7, 2024

@ikhwanperwira just fork the repo and add

custom dns resolver in http client I had the same issue I not sure these people will do the change in main repo and would not even see this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority: Normal Minor issue impacting one or more users Type: Feature Request A big idea that would be split into smaller pieces
Projects
None yet
Development

No branches or pull requests

2 participants