diff --git a/README.md b/README.md index 4c9f22a..67b5643 100644 --- a/README.md +++ b/README.md @@ -275,7 +275,7 @@ Flags: -b, --tcp-buffer="4KB" Size of TCP buffer to use. -i, --prefer-ip="prefer-ipv6" IP preference. By default we prefer IPv6 with fallback to IPv4. -p, --domain-fronting-port=443 A port to access for domain fronting. - -n, --doh-ip=9.9.9.9 IP address of DNS-over-HTTP to use. + -n, --doh-ip=1.1.1.1 IP address of DNS-over-HTTP to use. -t, --timeout=10s Network timeout to use -a, --antireplay-cache-size="1MB" A size of anti-replay cache to use. ``` diff --git a/example.config.toml b/example.config.toml index ad402ba..eb2c62c 100644 --- a/example.config.toml +++ b/example.config.toml @@ -93,8 +93,8 @@ ips = ["127.0.0.1:443"] # resolver of the operating system and uses DOH instead. This is a host # it has to access. # -# By default we use Quad9. -doh-ip = "9.9.9.9" +# By default we use Cloudflare. +doh-ip = "1.1.1.1" # mtg can work via proxies (for now, we support only socks5). Proxy # configuration is done via list. So, you can specify many proxies diff --git a/internal/cli/simple_run.go b/internal/cli/simple_run.go index 02d6dc3..53deb61 100644 --- a/internal/cli/simple_run.go +++ b/internal/cli/simple_run.go @@ -18,7 +18,7 @@ type SimpleRun struct { TCPBuffer string `kong:"name='tcp-buffer',short='b',default='4KB',help='Deprecated and ignored'"` //nolint: lll PreferIP string `kong:"name='prefer-ip',short='i',default='prefer-ipv6',help='IP preference. By default we prefer IPv6 with fallback to IPv4.'"` //nolint: lll DomainFrontingPort uint64 `kong:"name='domain-fronting-port',short='p',default='443',help='A port to access for domain fronting.'"` //nolint: lll - DOHIP net.IP `kong:"name='doh-ip',short='n',default='9.9.9.9',help='IP address of DNS-over-HTTP to use.'"` //nolint: lll + DOHIP net.IP `kong:"name='doh-ip',short='n',default='1.1.1.1',help='IP address of DNS-over-HTTP to use.'"` //nolint: lll Timeout time.Duration `kong:"name='timeout',short='t',default='10s',help='Network timeout to use'"` //nolint: lll Socks5Proxies []string `kong:"name='socks5-proxy',short='s',help='Socks5 proxies to use for network access.'"` //nolint: lll AntiReplayCacheSize string `kong:"name='antireplay-cache-size',short='a',default='1MB',help='A size of anti-replay cache to use.'"` //nolint: lll diff --git a/mtglib/internal/dc/view.go b/mtglib/internal/dc/view.go index f4ef7d9..efee1c0 100644 --- a/mtglib/internal/dc/view.go +++ b/mtglib/internal/dc/view.go @@ -2,13 +2,11 @@ package dc type dcView struct { overrides dcAddrSet - collected dcAddrSet } func (d dcView) getV4(dc int) []Addr { addrs := d.overrides.getV4(dc) addrs = append(addrs, defaultDCOverridesAddrSet.getV4(dc)...) - // addrs = append(addrs, d.collected.getV4(dc)...) addrs = append(addrs, defaultDCAddrSet.getV4(dc)...) return addrs @@ -17,7 +15,6 @@ func (d dcView) getV4(dc int) []Addr { func (d dcView) getV6(dc int) []Addr { addrs := d.overrides.getV6(dc) addrs = append(addrs, defaultDCOverridesAddrSet.getV6(dc)...) - // addrs = append(addrs, d.collected.getV6(dc)...) addrs = append(addrs, defaultDCAddrSet.getV6(dc)...) return addrs diff --git a/mtglib/internal/dc/view_test.go b/mtglib/internal/dc/view_test.go index 842c476..74d46cb 100644 --- a/mtglib/internal/dc/view_test.go +++ b/mtglib/internal/dc/view_test.go @@ -31,13 +31,6 @@ func (suite *ViewTestSuite) SetupSuite() { }, }, }, - collected: dcAddrSet{ - v4: map[int][]Addr{ - 1: { - {Network: "tcp4", Address: "127.1.0.1:443"}, - }, - }, - }, } } @@ -54,10 +47,6 @@ func (suite *ViewTestSuite) TestGetV4() { {"tcp4", "149.154.167.51:443"}, {"tcp4", "95.161.76.100:443"}, }, - 1: { - {"tcp4", "127.1.0.1:443"}, - {"tcp4", "149.154.175.50:443"}, - }, } for dc, addresses := range testData { diff --git a/network/init.go b/network/init.go index 52831c2..3baa8b0 100644 --- a/network/init.go +++ b/network/init.go @@ -63,7 +63,7 @@ const ( // DefaultDOHHostname defines a default IP address for DOH host. Since mtg is // simple, please pass IP address here. We do not have bootstrap servers here // embedded. - DefaultDOHHostname = "9.9.9.9" + DefaultDOHHostname = "1.1.1.1" // DNSTimeout defines a timeout for DNS queries. DNSTimeout = 5 * time.Second