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

[gomobile-lib] implement a cleaner workaround for DNS resolver #19

Closed
aeddi opened this issue Jan 21, 2020 · 4 comments
Closed

[gomobile-lib] implement a cleaner workaround for DNS resolver #19

aeddi opened this issue Jan 21, 2020 · 4 comments
Labels
bug Something isn't working

Comments

@aeddi
Copy link
Member

aeddi commented Jan 21, 2020

DNS Lookup does not work by default with gomobile on Android and iOS (only on physical device). We needed to find a workaround until this golang issue is fixed.

At the moment we are using this method which is very hacky.

We could instead:

@aeddi aeddi changed the title [gomobile-lib] implement a cleaner workaround for DNS [gomobile-lib] implement a cleaner workaround for DNS resolver Jan 21, 2020
@aeddi aeddi added bug Something isn't working help wanted labels Jan 21, 2020
@gfanton
Copy link
Member

gfanton commented Jan 21, 2020

Find a clean way to override the default go-ipfs DNSResolver

@Stebalien What do you think would be the best approach to do that? If we could simply implement a DNSResolver interface and have a way to override it, it could be cleaner that implementing the Namesys interface and duplicate all the original code for the sole purpose of overriding the LookupTXT method.

@moul
Copy link
Member

moul commented Jan 29, 2020

cc @steeve

@steeve
Copy link

steeve commented Jan 29, 2020

You can enable CGo and let it use the CGo resolver instead. Since CGo is needed anyway when doing gomobile bind it's not really any different build wise.

I thought that gomobile bind did it but you can try to add CGO_ENABLED=1 to the env or disable the build tag netgo.

We've been running with it since day 1, and to us it has never been an issue. There were some quirks with respect to DNS resolution on iOS (stuck resolver on weird network conditions), but I'm not sure they are still there.

@aeddi
Copy link
Member Author

aeddi commented Sep 27, 2022

@aeddi aeddi closed this as completed Sep 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants