deltachat-core-rust icon indicating copy to clipboard operation
deltachat-core-rust copied to clipboard

Use `/dev/socket/dnsproxyd` on Android rather than 8.8.8.8 for MX record resolution

Open link2xt opened this issue 1 year ago • 0 comments

Currently the core falls back to using 8.8.8.8 resolver if /etc/resolv.conf is not found, which is the case on Android: https://github.com/deltachat/deltachat-core-rust/blob/2f5c6b5e1601427b1c343f8b385688e9e057b657/src/provider.rs#L163-L177 This fallback was added in https://github.com/deltachat/deltachat-core-rust/pull/2852

We should fallback to using /dev/socket/dnsproxyd instead which is a stable interface maintained even on newer Android for compatibility reason and it is easy to use: https://github.com/hickory-dns/hickory-dns/issues/652#issuecomment-1781994055 Queries can be created using hickory-proto which is the same library we use for DNS resolution now: https://docs.rs/hickory-proto/latest/hickory_proto/op/query/struct.Query.html

Related forum thread: https://support.delta.chat/t/why-connection-to-googledns-8-8-8-8/2074

For Linux platform this /dev/socket/dnsproxyd can be tried unconditionally as deltachat-rpc-server binaries do not know if they are going to be running on Linux or in Termux on Android.

link2xt avatar Oct 27 '23 17:10 link2xt