clash_for_windows_pkg icon indicating copy to clipboard operation
clash_for_windows_pkg copied to clipboard

求教:关于 Clash 和 Firefox DoH DNS 设置的迷惑。

Open 4SM opened this issue 2 years ago • 3 comments

功能描述

在 Mixin 中设置:

mixed-port: 7890	
allow-lan: false	
bind-address: '*'
mode: rule	
log-level: silent

tun:
  enable: true
  stack: system
  dns-hijack:
    - 198.18.0.2:53
  auto-route: true
  auto-detect-interface: true

dns:
  enable: true
  ipv6: false
  listen: 127.0.0.1:53

  default-nameserver:
    - 223.5.5.5
    - 119.29.29.29
    - 114.114.114.114
    - 1.1.1.1
    - 8.8.8.8
    - 9.9.9.9

  enhanced-mode: fake-ip
  fake-ip-range: 198.18.0.1/16
  fake-ip-filter:
    - '*.lan'
    - '*.linksys.com'
    - '*.linksyssmartwifi.com'
    - '*.msftconnecttest.com'
    - '*.msftncsi.com'

  nameserver:	
    - https://dns.alidns.com/dns-query
    - https://doh.pub/dns-query
    - x.x.x.x    # 公司内网的 DNS
  fallback:	
    - https://cloudflare-dns.com/dns-query
    - https://dns.google/dns-query
    - tls://1.0.0.1:853
    - tls://dns.google:853

  fallback-filter:
    geoip: true
    geoip-code: CN
    ipcidr:
      - 240.0.0.0/4

在 Firefox about:config 中设置:

network.trr.mode=2
network.trr.custom_uri = https://doh.dns.sb/dns-query
network.trr.uri= https://doh.dns.sb/dns-query
network.trr.enable_when_proxy_detected = true
network.security.esni.enabled = true
  1. Firefox 如果启用了 DoH,那么是否会覆盖 Mixin 中的 DNS 分流?举例:www.jd.com 会直接跳转到 www.hk.jd.com。 有些国内的网站载入会变慢。如果不启用 Firefox DoH,www.jd.com 不会跳转。那么我即使在 Mixin 中设置 DoH DNS,在 Firefox 中似乎也是无效的。访问测试网站 https://www.cloudflare.com/cdn-cgi/trace 其结果:sni=plaintext. 那么究竟关于 Clash Mixin 以及 Firefox 如何设置才能既保证安全的 DoH,又实现 DNS 分流?
  2. Mixin 是会覆盖掉 Profires 中的配置?
  3. 公司内网的 DNS 在 写入 nameserver 但还是不能访问,是不是设置有问题?公司内网 DNS 通过单击 Windows 10 设置→网络和Internet→(已连接的 WiFi) 属性→IPv4 DNS 服务器:x.x.x.x

在此,感谢各位大佬的帮助。谢谢。

其他内容

No response

4SM avatar Aug 04 '22 01:08 4SM

  1. mixin 的 dns 以最快响应为准,不会分流,只有 fallback。
  2. 会覆盖,但是发生在内存里,所以配置文件不变。
  3. 可能不是第一响应的?

yi-Xu-0100 avatar Aug 04 '22 01:08 yi-Xu-0100

  1. mixin 的 dns 以最快响应为准,不会分流,只有 fallback。

    1. 会覆盖,但是发生在内存里,所以配置文件不变。

    2. 可能不是第一响应的?

  1. 那么 Firefox 应该开启 Doh 吗?如果启用,那么 Clash 的 DNS 配置是不是失效?强制全部使用 https://mozilla.cloudflare-dns.com/dns-query?
  2. 无疑问。
  3. 应该如果写配置呢?让公司 DNS 第一响应?

谢谢。

4SM avatar Aug 04 '22 05:08 4SM

  1. 不知道为啥要用 firefox 开 doh,不确定影响
  2. 关于特定域名需要特定 dns 解析,可以使用 nameserver-policy ,见 https://github.com/Dreamacro/clash/wiki/configuration

yi-Xu-0100 avatar Aug 04 '22 05:08 yi-Xu-0100

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days

Fndroid avatar Oct 04 '22 00:10 Fndroid