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

How can I specify DNS Resolver as environment variable or command line argument #1393

Open
directentis1 opened this issue Jan 13, 2025 · 0 comments
Labels
Priority: Normal Minor issue impacting one or more users Type: Feature Request A big idea that would be split into smaller pieces

Comments

@directentis1
Copy link

directentis1 commented Jan 13, 2025

*Describe the feature you'd like
As the title, because cloudflared uses go dns resolver, it looks for /etc/resolv.conf (for linux binaries) when try to resolve domains - which not the case on Android systems.

If it doen't find that file, it sets the default name server to localhost:53
https://github.com/golang/go/blob/e335a2665f5e322a7da8baa22fe816b6ef9aaf24/src/net/dnsconfig.go#L14

Which cause problems as here:
screenshot-573341226

There's a few possible solutions:

  • On rooted Android phone, we could just create the /etc/resolv.conf file
  • Another way is to add a static entry to /etc/hosts for our domainns
  • Building a non-staticly linked version cloudflared. If we build a binary linked to libc it will use that to do name resolution which will probably fix this issue.

The first two require the device/emulator to be rooted.
The third one is too annoying because cloudflared is constantly updated, and adding a release build/fork for this is waste time.

Describe alternatives you've considered
Are there any alternatives to solving this problem? If so, what was your experience with them?
I think environment variable or command line argument is the best way in a scripting context.

@directentis1 directentis1 added Priority: Normal Minor issue impacting one or more users Type: Feature Request A big idea that would be split into smaller pieces labels Jan 13, 2025
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

1 participant