Change default DOH to cloudflarte

This commit is contained in:
9seconds
2026-02-16 17:18:31 +01:00
parent 074c4017f5
commit 36546cec2f
6 changed files with 5 additions and 19 deletions
+1 -1
View File
@@ -275,7 +275,7 @@ Flags:
-b, --tcp-buffer="4KB" Size of TCP buffer to use. -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. -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. -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 -t, --timeout=10s Network timeout to use
-a, --antireplay-cache-size="1MB" A size of anti-replay cache to use. -a, --antireplay-cache-size="1MB" A size of anti-replay cache to use.
``` ```
+2 -2
View File
@@ -93,8 +93,8 @@ ips = ["127.0.0.1:443"]
# resolver of the operating system and uses DOH instead. This is a host # resolver of the operating system and uses DOH instead. This is a host
# it has to access. # it has to access.
# #
# By default we use Quad9. # By default we use Cloudflare.
doh-ip = "9.9.9.9" doh-ip = "1.1.1.1"
# mtg can work via proxies (for now, we support only socks5). Proxy # mtg can work via proxies (for now, we support only socks5). Proxy
# configuration is done via list. So, you can specify many proxies # configuration is done via list. So, you can specify many proxies
+1 -1
View File
@@ -18,7 +18,7 @@ type SimpleRun struct {
TCPBuffer string `kong:"name='tcp-buffer',short='b',default='4KB',help='Deprecated and ignored'"` //nolint: lll 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 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 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 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 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 AntiReplayCacheSize string `kong:"name='antireplay-cache-size',short='a',default='1MB',help='A size of anti-replay cache to use.'"` //nolint: lll
-3
View File
@@ -2,13 +2,11 @@ package dc
type dcView struct { type dcView struct {
overrides dcAddrSet overrides dcAddrSet
collected dcAddrSet
} }
func (d dcView) getV4(dc int) []Addr { func (d dcView) getV4(dc int) []Addr {
addrs := d.overrides.getV4(dc) addrs := d.overrides.getV4(dc)
addrs = append(addrs, defaultDCOverridesAddrSet.getV4(dc)...) addrs = append(addrs, defaultDCOverridesAddrSet.getV4(dc)...)
// addrs = append(addrs, d.collected.getV4(dc)...)
addrs = append(addrs, defaultDCAddrSet.getV4(dc)...) addrs = append(addrs, defaultDCAddrSet.getV4(dc)...)
return addrs return addrs
@@ -17,7 +15,6 @@ func (d dcView) getV4(dc int) []Addr {
func (d dcView) getV6(dc int) []Addr { func (d dcView) getV6(dc int) []Addr {
addrs := d.overrides.getV6(dc) addrs := d.overrides.getV6(dc)
addrs = append(addrs, defaultDCOverridesAddrSet.getV6(dc)...) addrs = append(addrs, defaultDCOverridesAddrSet.getV6(dc)...)
// addrs = append(addrs, d.collected.getV6(dc)...)
addrs = append(addrs, defaultDCAddrSet.getV6(dc)...) addrs = append(addrs, defaultDCAddrSet.getV6(dc)...)
return addrs return addrs
-11
View File
@@ -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", "149.154.167.51:443"},
{"tcp4", "95.161.76.100: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 { for dc, addresses := range testData {
+1 -1
View File
@@ -63,7 +63,7 @@ const (
// DefaultDOHHostname defines a default IP address for DOH host. Since mtg is // 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 // simple, please pass IP address here. We do not have bootstrap servers here
// embedded. // embedded.
DefaultDOHHostname = "9.9.9.9" DefaultDOHHostname = "1.1.1.1"
// DNSTimeout defines a timeout for DNS queries. // DNSTimeout defines a timeout for DNS queries.
DNSTimeout = 5 * time.Second DNSTimeout = 5 * time.Second