[PR #3278] [MERGED] Get Android's DNS servers #3706

Closed
opened 2026-03-16 11:58:19 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/hickory-dns/hickory-dns/pull/3278
Author: @LAGonauta
Created: 9/25/2025
Status: Merged
Merged: 9/27/2025
Merged by: @djc

Base: mainHead: android-dns-servers


📝 Commits (1)

  • d92f43b Add support for getting DNS servers from the Android system

📊 Changes

9 files changed (+513 additions, -116 deletions)

View changed files

📝 Cargo.lock (+9 -0)
📝 Cargo.toml (+3 -1)
📝 conformance/Cargo.lock (+230 -110)
📝 crates/proto/Cargo.toml (+3 -0)
📝 crates/proto/src/error.rs (+12 -0)
📝 crates/resolver/Cargo.toml (+5 -1)
crates/resolver/src/system_conf/android.rs (+86 -0)
📝 crates/resolver/src/system_conf/mod.rs (+10 -2)
📝 fuzz/Cargo.lock (+155 -2)

📄 Description

This PR should resolve #652.

I am developing an app with Slint. It uses a library that relies on hickory to make some DNS requests, such as SRV requests.
However, I want to build for both desktop and Android. While I could modify the library to accept a custom config with the DNS servers, modifying hickory itself seems the better solution.

This PR adds code to call Android APIs through JNI to get the servers, and should work from Marshmallow (6.0, API level 23) onward. I tested on Android 13, but I will test on Android 6.0 soon.

This is my first time contributing to a library like hickory, so please forgive me if my code is not easy to follow. JNI can be quite confusing, so I added a comment with the Android reference for each call.

Feel free to ask me any questions, or to request any changes.

Thanks, and I hope we can get this into hickory!


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/hickory-dns/hickory-dns/pull/3278 **Author:** [@LAGonauta](https://github.com/LAGonauta) **Created:** 9/25/2025 **Status:** ✅ Merged **Merged:** 9/27/2025 **Merged by:** [@djc](https://github.com/djc) **Base:** `main` ← **Head:** `android-dns-servers` --- ### 📝 Commits (1) - [`d92f43b`](https://github.com/hickory-dns/hickory-dns/commit/d92f43b6c1af01759c1c3639984c9f4b0702515d) Add support for getting DNS servers from the Android system ### 📊 Changes **9 files changed** (+513 additions, -116 deletions) <details> <summary>View changed files</summary> 📝 `Cargo.lock` (+9 -0) 📝 `Cargo.toml` (+3 -1) 📝 `conformance/Cargo.lock` (+230 -110) 📝 `crates/proto/Cargo.toml` (+3 -0) 📝 `crates/proto/src/error.rs` (+12 -0) 📝 `crates/resolver/Cargo.toml` (+5 -1) ➕ `crates/resolver/src/system_conf/android.rs` (+86 -0) 📝 `crates/resolver/src/system_conf/mod.rs` (+10 -2) 📝 `fuzz/Cargo.lock` (+155 -2) </details> ### 📄 Description This PR should resolve #652. I am developing an app with Slint. It uses a library that relies on hickory to make some DNS requests, such as SRV requests. However, I want to build for both desktop and Android. While I could modify the library to accept a custom config with the DNS servers, modifying hickory itself seems the better solution. This PR adds code to call Android APIs through JNI to get the servers, and should work from Marshmallow (6.0, API level 23) onward. I tested on Android 13, but I will test on Android 6.0 soon. This is my first time contributing to a library like hickory, so please forgive me if my code is not easy to follow. JNI can be quite confusing, so I added a comment with the Android reference for each call. Feel free to ask me any questions, or to request any changes. Thanks, and I hope we can get this into hickory! --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-16 11:58:19 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/hickory-dns#3706
No description provided.