-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Replace resolv.conf usage with android default nameserver(s)? #1174
Comments
Hm, I thought most apps use the android system dns server - only |
From @rugk on August 5, 2016 11:48
However when some tools do it differently this is much more confusing. There should be a consistent behaviour, otherwise this complicates debugging and such things. My initial request is still valid through: Apps honouring the custom resolv.conf should be able to use the built-in Android dns server. At least thee should be a consistent behaviour. |
Normally the libc implementation of the resolver uses As for I guess the system name server can be obtained with |
From @rugk on August 5, 2016 13:46
Yeah, I am 👍 of "as an option". 😃
Nice, did not knew about "getprop". Is this Android-specific or is this something Termux adds as a console command? So I can use "getprop net.dns1" to get the dns server and write it into the resolv.conf file. And of course this works. I mean I also do know the dns server Android currently uses so I can "hardcode" it into the resolv.conf file, but this is only a workaround and no generic solution for this issue. |
From @glitchphan on September 14, 2016 15:37 What about |
From @rugk on September 14, 2016 17:59 No, this does not work either. In this case it shows a parsing error. |
From @jsainzvela on April 19, 2017 14:23 Just found out about Termux and I think it is awesome already! :) I have the same problem as depicted in this topic, has anybody found a solution to overwrite the resolv.conf file with the Thanks! Jorge |
Some thoughts / questions.
|
getprop net.dns1 is not compatible with VPNs, it still shows system DNS. The right solution is to use getDnsServers though jni but it was introduced very recently. So in all it seems that using 8.8.8.8 for few packages that need DNS server name rather than just resolving through system libc is the best solution available |
This comment was marked as spam.
This comment was marked as spam.
I am using this for making resolv.conf in Alpine |
@Hax4us: it doesn't work with VPN. Right way it's to get it from Android network apis |
This comment was marked as spam.
This comment was marked as spam.
@Hax4us So I prefer to use one/two of the following DNS servers:
|
This was a behaviour change in Android 8.0 which hides/drop these:
|
This comment was marked as spam.
This comment was marked as spam.
@SDRausty No. This can be queried from Android application only. |
This comment was marked as spam.
This comment was marked as spam.
Too much nuisance. I would just forge a Magisk module to get a |
This comment was marked as spam.
This comment was marked as spam.
This comment was marked as spam.
This comment was marked as spam.
@y0umu Not all users have root/Magisk installed. |
This comment was marked as spam.
This comment was marked as spam.
No it is not going to fulfill this request easily since not everyone would like to void the gurantee to have Magisk installed. As for the issue itself, the module I cooked myself merely satifies my needs in that Go applications now have smooth network connections with the presence of
Sorry for my zero knowledge on Android devloping... |
This confused me for a while, as I was using nslookup to confirm my DNS changes via Termux |
This issue/PR has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This is still worth discussing. |
With all being said, I guess the only solution would be for termux to provide a local resolver a la systemd-resolved, proxying requests through Android's DNS system, and injecting it's own private ip address on resolved.conf. But seeing that there are only a few packages relying on resolved.conf, it may not really be worth it to implement such thing. |
For curl/wget, I can use proxychains-ng:
|
This comment was marked as off-topic.
This comment was marked as off-topic.
If you're happy with sending all your DNS requests to Cloudflare... |
This comment was marked as off-topic.
This comment was marked as off-topic.
@MasterKia [EDIT] Deleted an unrelated mention. |
Any update on this? I am using dnsutils a lot and this is causing issues to me. need to use DNS servers that are offered from DHCP or VPN... |
There will be an update once someone will suggest a reliable way of retrieving current DNS servers from the OS which works on all Android versions. Until that, issue has lowest priority. No, the already suggested |
+1 |
Using POSIX methods is unfortunately not enough, as the Alternatively, we have to find the DNS server IPs and write them into I don't know how this interacts with DNS over TLS enabled in Android's settings. |
@Mynacol The actual issue is: We have very few packages that do DNS resolution on their own instead of using methods provided by libc. Such packages use Here I would like to note that majority of packages do not need The issue is not properly described in ticket comment #1174 (comment) which lead to misunderstanding. Due to lack of productive discussion, solution proofs of concept, pull requests and maintainers interest in general, I'm closing this issue. Personally I would like to keep |
I want to +1 this - this just sent me into utter confusion for a long while. Is there some command I can use to query the OS' DNS settings and use Termux:Boot to possibly set them up? My idea was to run a cron and see if my IP on Thanks! |
This is by no means a completely generalized solution, but I wrote this |
From @rugk on August 5, 2016 9:25
Currently termux always uses the servers listed in
/usr/etc/resolv.conf
.However I'd like it to use the default android dns server. At least when there is no entry in the resolv file it should be used.
Otherwise a special entry such as
nameserver default
would be useful to indicate that the default android name server should be used.I mean in a mobile network it might of course be the same as configured in the file (google name server), but when connected to a wi-fi network this is different.
Copied from original issue: termux/termux-app#130
The text was updated successfully, but these errors were encountered: