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

Don't use the system default resolver implicitly #647

Closed
ameshkov opened this issue Mar 21, 2019 · 6 comments
Closed

Don't use the system default resolver implicitly #647

ameshkov opened this issue Mar 21, 2019 · 6 comments
Assignees
Milestone

Comments

@ameshkov
Copy link
Member

There're a couple of places in the code where we use system default resolver implicitly:

  • Downloading filters updates
  • Communicating with the browsing security and parental control web services
  • Checking application update

Ideally, we should avoid doing it. But I don't like the idea of propagating the custom resolver to every place where we make a http request. Can we somehow change the default resolver globally?

@ameshkov ameshkov added this to the v0.95 milestone Mar 21, 2019
@ameshkov ameshkov changed the title Don't use system default resolver Don't use the system default resolver implicitly Mar 21, 2019
@szolin
Copy link
Contributor

szolin commented Mar 26, 2019

May be relevant: golang/go#12503

@szolin szolin closed this as completed in 00ba633 Apr 23, 2019
@ameshkov
Copy link
Member Author

Here's what I see on first run:

2019/04/23 19:01:35 [info] Couldn't request filter from URL https://adguardteam.github.io/AdGuardSDNSFilter/Filters/filter.txt, skipping: Get https://adguardteam.github.io/AdGuardSDNSFilter/Filters/filter.txt: lookup adguardteam.github.io on 192.168.10.125:53: read udp 127.0.0.1:57264->127.0.0.1:53: read: connection refused
2019/04/23 19:01:35 [info] Failed to update filter https://adguardteam.github.io/AdGuardSDNSFilter/Filters/filter.txt: Get https://adguardteam.github.io/AdGuardSDNSFilter/Filters/filter.txt: lookup adguardteam.github.io on 192.168.10.125:53: read udp 127.0.0.1:57264->127.0.0.1:53: read: connection refused

We shouldn't load filters unless AGH DNS server is running.

@ameshkov ameshkov reopened this Apr 23, 2019
@ameshkov
Copy link
Member Author

And here's the second issue: handle DNS host=0.0.0.0 -- use 127.0.0.1 in this case.

@ameshkov
Copy link
Member Author

Fixed

ameshkov added a commit that referenced this issue Apr 23, 2019
@ameshkov ameshkov modified the milestones: v0.95, v0.96 Apr 23, 2019
@ameshkov
Copy link
Member Author

ameshkov commented Apr 23, 2019

I had to roll it back due to the Docker-related issue:
#730

See some details here:
https://stackoverflow.com/questions/24319662/from-inside-of-a-docker-container-how-do-i-connect-to-the-localhost-of-the-mach/52858101

Also, I just realized that we're passing resolverAddr via global variable and that can be done better.

@ameshkov ameshkov reopened this Apr 23, 2019
@ameshkov ameshkov modified the milestones: v0.96, v0.95 Apr 23, 2019
@ameshkov
Copy link
Member Author

ameshkov commented Apr 23, 2019

False alarm :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants