guoguobaba
V2EX  ›  DNS

cloudflare 自建 doh

  •  
  •   guoguobaba · Dec 30, 2025 · 5786 views
    This topic created in 311 days ago, the information mentioned may be changed or developed.

    https://github.com/cmliu/CF-Workers-DoH

    基于这个在 cf 上自建了一个 doh ,发现 gfw 会针对域名进行封锁,比如取名 dns.mydomain.xyz 或者 doh.mydomain.xyz ,甚至 mydoh.mydomain.xyz 都无法访问,后来改名叫 domain.mydomain.xyz ,就行了

    curl https://mydoh.mydomain.xyz/ -v -4
    * Host mydoh.mydomain.xyz:443 was resolved.
    * IPv6: (none)
    * IPv4: 104.21.7.35, 172.67.135.177
    *   Trying 104.21.7.35:443...
    * ALPN: curl offers h2,http/1.1
    * TLSv1.3 (OUT), TLS handshake, Client hello (1):
    *  CAfile: /etc/ssl/certs/ca-certificates.crt
    *  CApath: none
    * Recv failure: Connection reset by peer
    * TLS connect error: error:00000000:lib(0)::reason(0)
    * OpenSSL SSL_connect: Connection reset by peer in connection to mydoh.mydomain.xyz:443
    * closing connection #0
    curl: (35) Recv failure: Connection reset by peer
    
    18 replies  •  2025-12-31 09:35:36 +08:00
    Solix
    Solix
    Dec 30, 2025
    1
    你都用 cf 了,不用自建,直接用 cloudflare-gateway 不得了
    totoro625
    totoro625
    Dec 30, 2025
    2
    @Solix #1 他解决了 GFW 对于 cloudflare-gateway 域名链接的干扰
    Solix
    Solix
    Dec 30, 2025
    3
    @totoro625 #2 实际上 Zero Trust 创建的 xxx.cloudflare-gateway.com 没有干扰
    starrys
    starrys
    Dec 30, 2025❤️1
    4
    改名后你使用多长时间了,稳定吗?
    我怀疑 GFW 会根据流量特征识别,可能用几天就用不了了。而且,网络延迟也比较高,解析速度较慢。所以,我的意见是,为什么不直接走代理?
    hash
    hash
    Dec 30, 2025❤️1
    5
    我的经验是如果域名符合 dns 特征,那么 GFW 会主动探测 `/dns-query`
    我的同一个域名配置 DOH 后过几天就会被阻断,就关闭服务.
    一段时间域名恢复访问后,再次配置 DOH 可访问.一段时间后再次阻断.
    这一次等域名回复后,同一个域名在服务端路径 `/dns-query` 修改为 `/xxx-query`
    快一年了,一直正常
    p4d9k
    p4d9k
    Dec 30, 2025
    6
    域名不要弄和 dns 、doh 有关,不要这么做,以及路径要改成随机的,会被探测。
    lnbiuc
    lnbiuc
    Dec 30, 2025
    7
    建议改成 health-check.example.com 路径改成随机字符串
    superkkk
    superkkk
    Dec 30, 2025
    8
    随机域名和随机 path 用了 2 年了完全没事
    MZRME
    MZRME
    Dec 30, 2025
    9
    之前用 az 搭建的 差不多 1 天就挂 半年恢复
    guoguobaba
    guoguobaba
    OP
    Dec 30, 2025
    10
    @hash 我觉得和 path 关系不大,https 探测不到 path ,和域名关系比较大。
    p4d9k
    p4d9k
    Dec 30, 2025
    11
    @guoguobaba 可以主动去请求 /dns-query 解析呀,有回应就可以屏蔽了
    dn1095239
    dn1095239
    Dec 30, 2025❤️1
    12
    还是跟流量有关,我自用的域名就是 dns.xxx.eu.org ,path 也是默认的,可以说槽点拉满,但用了几年甚至 5 月 31 日都没事
    LGA1150
    LGA1150
    Dec 30, 2025❤️1
    13
    按同样的思路搭一个蜜罐,把前来探测的 IP 全拉黑
    allplay
    allplay
    Dec 30, 2025
    14
    @guoguobaba #10 和路径有关。如果你你不带路径的话,相当于域名裸奔,直接被端口探测。
    br2049
    br2049
    Dec 30, 2025
    15
    关键是 cf 的 ping 很高 如果用代理那直接用 1111 就行了
    someonesnone
    someonesnone
    Dec 30, 2025 via Android
    16
    建议域名混淆为 generate 204😄
    guoguobaba
    guoguobaba
    OP
    Dec 31, 2025
    17
    @br2049 碰到机场域名本地 dns 不解析,连 1.1.1.1/8.8.8.8 又需要机场代理这种现象
    szdosar
    szdosar
    Dec 31, 2025
    18
    自建还是要用白名单限制访问比较稳。自己用可以,但对外开放就不稳了。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   2084 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 42ms · UTC 02:22 · PVG 10:22 · LAX 18:22 · JFK 21:22
    ♥ Do have faith in what you're doing.