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

c-ares ignores domain search suffix on Android #207

Closed
ArtsviKarayan opened this issue Jul 12, 2018 · 2 comments
Closed

c-ares ignores domain search suffix on Android #207

ArtsviKarayan opened this issue Jul 12, 2018 · 2 comments

Comments

@ArtsviKarayan
Copy link

On Linux the domain search is retrieved from the resolve.conf.
The following example does not work on Android (e.g. ok on Linux):

  • Domain search: "example.domain.search.com"
  • Actual domain: "actualdom.example.domain.search.com"
  • Name passed to ares_gethostbyname: "actualdom"
  • Result: No resolved ip

I have investigated the sources little bit and it seems that the "domain search" config is not initialized on Android. The name servers are retrieved from the Android system properties but the domain search property is not retrieved and used any more.

@bradh352
Copy link
Member

You are right, it would make sense to also pull in getDomains() from the link properties.
Think this was just skipped due to the sheer complexity of calling Java from C, but it would be good to add. Pulling in the original submitter of the modern Android code for c-ares, @user-none

https://developer.android.com/reference/android/net/LinkProperties.html#getDomains()

@user-none
Copy link
Contributor

Pull request for this #211.

DronRathore pushed a commit to DronRathore/c-ares that referenced this issue Mar 11, 2020
Fixes issue c-ares#207. Uses LinkProperties.getDomains() to get a list of search domains and adds them to the suffix list.  This also adds a new helper function to split strings into an array based on multiple delimiters replacing multiple other functions for dealing with string splitting.

Submitter: John Schember (@user-none)
Fixes: c-ares#207 
Approved-by: Brad House (@bradh352)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants