DNSCrypt / dnscrypt-proxy

dnscrypt-proxy 2 - A flexible DNS proxy, with support for encrypted DNS protocols.
https://dnscrypt.info
ISC License
11.11k stars 993 forks source link

Configured bootstrap_resolvers not used for the http_proxy domains #2256

Open zer0tru5t opened 1 year ago

zer0tru5t commented 1 year ago

Platform: macOS Version: 2.1.2

./dnscrypt-proxy -version 2.1.2

./dnscrypt-proxy -check [2022-12-05 13:10:45] [NOTICE] dnscrypt-proxy 2.1.2 [2022-12-05 13:10:45] [NOTICE] Source [public-resolvers] loaded [2022-12-05 13:10:45] [NOTICE] Configuration successfully checked

./dnscrypt-proxy -resolve google.com Resolving [google.com] using 127.0.0.1 port 53

Steps to Reproduce

root@xxxx-mbp /Applications# ./dnscrypt-proxy
[2022-12-05 13:05:19] [NOTICE] dnscrypt-proxy 2.1.2
[2022-12-05 13:05:19] [NOTICE] Network connectivity detected
[2022-12-05 13:05:19] [NOTICE] Now listening to 127.0.0.1:53 [UDP]
[2022-12-05 13:05:19] [NOTICE] Now listening to 127.0.0.1:53 [TCP]
[2022-12-05 13:05:19] [NOTICE] Source [public-resolvers] loaded
[2022-12-05 13:05:19] [NOTICE] Firefox workaround initialized
[2022-12-05 13:05:39] [ERROR] Get "https://dns.cloudflare.com/dns-query?dns=yv4BAAABAAAAAAABAAACAAEAACkQAAAAAAAAFAAMABBAWJM8BRTVGzjmZQ4GvgyM": context deadline exceeded
[2022-12-05 13:05:39] [NOTICE] dnscrypt-proxy is waiting for at least one server to be reachable
^C[2022-12-05 13:08:41] [NOTICE] Stopped.

Configuration

listen_addresses = ['127.0.0.1:53']
server_names = ['google','cloudflare']

http_proxy = 'http://proxy.acme.com:1883'
doh_servers = true
ipv4_servers = true

bootstrap_resolvers = ['192.168.10.1:53']
ignore_system_dns = true

cache = true

[sources]
  [sources.public-resolvers]
    urls = ['https://download.dnscrypt.info/resolvers-list/v3/public-resolvers.md']
    cache_file = 'public-resolvers.md'
    minisign_key = 'RWQf6LRCGA9i53mlYecO4IzT51TGPpvWucNSCh1CBM0QTaLn73Y7GFO3'
    refresh_delay = 72

Expected behavior (i.e., solution)

http_proxy domain (e.g., proxy.acme.com) must be resolved using the bootstrap_resolvers.

[2022-12-05 13:09:04] [NOTICE] dnscrypt-proxy 2.1.2
[2022-12-05 13:09:04] [NOTICE] Network connectivity detected
[2022-12-05 13:09:04] [NOTICE] Now listening to 127.0.0.1:53 [UDP]
[2022-12-05 13:09:04] [NOTICE] Now listening to 127.0.0.1:53 [TCP]
[2022-12-05 13:09:04] [NOTICE] Source [public-resolvers] loaded
[2022-12-05 13:09:04] [NOTICE] Firefox workaround initialized
[2022-12-05 13:09:04] [NOTICE] [cloudflare] OK (DoH) - rtt: 26ms
[2022-12-05 13:09:04] [NOTICE] [google] OK (DoH) - rtt: 33ms
[2022-12-05 13:09:04] [NOTICE] Sorted latencies:
[2022-12-05 13:09:04] [NOTICE] -    26ms cloudflare
[2022-12-05 13:09:04] [NOTICE] -    33ms google
[2022-12-05 13:09:04] [NOTICE] Server with the lowest initial latency: cloudflare (rtt: 26ms)
[2022-12-05 13:09:04] [NOTICE] dnscrypt-proxy is ready - live servers:

Other Comments

It works with the following scenarios, so the http_proxy domains are likely not resolved.

lifenjoiner commented 1 year ago

Use IP instead of the domain for the http_proxy (e.g., https://192.168.1.100:1883/ instead of https://proxy.acme.com:1883/)

I think it is the easy solution and normal way, that leads people without motivation to do it in the hard way.