sainnhe / sainnhe.github.io

Personal Blog
https://www.sainnhe.dev/
1 stars 0 forks source link

post/best-practice-for-dns-in-clash/ #13

Open utterances-bot opened 1 year ago

utterances-bot commented 1 year ago

Clash 配置 DNS 的最佳实践,没有之一 - sainnhe's blog

基础 让我们先从官方 Wiki 开始看起。 先来看这样一段配置: 1 2 3 4 5 6 7 8 9 10 11 dns: enable: true listen: 0.0.0.0:53 ipv6: true default-nameserver: - 114.114.114.114 - 8.8.8.8 nameserver: - 114.114.114.114 - https://doh.pub/dns-query - tls://dns.alidns.com:853 我们来一个一个看。 enable 字段用于设

https://www.sainnhe.dev/post/best-practice-for-dns-in-clash/

GD2021 commented 1 year ago

博主有视频教程吗?在哪个平台,我去给您三连

GD2021 commented 1 year ago

Add Env Variable CLOUD_PLATFORM: deno-deploy RUNTIME: deno DENO_ENV: production 这一部中的DENO_ENV: production无法保存,DENO_ENV输入框红色

sainnhe commented 1 year ago

@GD2021

博主有视频教程吗?在哪个平台,我去给您三连

暂时没打算出视频。

Add Env Variable

CLOUD_PLATFORM: deno-deploy

RUNTIME: deno

DENO_ENV: production

这一部中的DENO_ENV: production无法保存,DENO_ENV输入框红色

没碰到过,建议给 deno 提个 issue。

你也可以试试创建好之后在 dashboard 的 settings 里面创建,创建完之后再重新部署一下。

Arnie97 commented 1 year ago

1.1.1.1 是 Cloudflare 的 DNS,8.8.8.8 是谷歌的 DNS,都能在国内访问,都能保证无污染

这句话不对。大陆通过 UDP 53 访问境外 DNS 服务器会被抢答劫持,随机返回另一个已被 TCP Reset 拦截的地址,例如:

$ nslookup facebook.com 1.1.1.1
Server:     1.1.1.1
Address:    1.1.1.1:53

Non-authoritative answer:
Name:   facebook.com
Address: 108.160.167.159

Non-authoritative answer:
Name:   facebook.com
Address: 2a03:2880:f10c:283:face:b00c:0:25de

查询 ASN 可知该 IP 108.160.167.159 实际属于 DropBox。

这实际上是个先有鸡还是先有蛋的问题,doh.pub 能被 1.1.1.1 解析只是因为 DNSPod 拥有互联网域名解析服务牌照,而不是因为国内通过 UDP 53 查询 1.1.1.1 一定不会被污染

sainnhe commented 1 year ago

@Arnie97 感谢指正!已在原文中做了相应修改。

HAOLANYANG commented 8 months ago

如果falllback都换成ip地址形式的doh,那default-nameserver应该只用解析nameserver中的dns服务器域名,可以只把default-namesever换成223.5.5.5等这些国内公共dns吗?或者nameserver也换成ip形式的dns如https://223.5.5.5/dns-query,那么可以直接不用default-namesever吗

h4rvey-g commented 7 months ago

非常好的文章,希望博主有时间再补充一下fake-ip和sniffing的作用

vvxiang commented 7 months ago

写得很好,免费自建 DNS 这个步骤能不能出个详细的教程?

MrCloudyGod commented 6 months ago

Add Env Variable那一步填DENO_ENV: production这个变量的时候 提示Invalid key:DENO_is a reserved prefix 然后我前面就去掉DENO_填ENV了,dns服务也跑起来了,不知道会有什么问题在里面吗

gukingle commented 6 months ago

Run denoland/deployctl@1.4.0 Project: *** Entrypoint: file:///src/rethinkdns.js Error: APIError: The authorization token is not valid. x-deno-ray: c6d39113afd32fa14d03649b2effae65 If you encounter this error frequently, contact us at deploy@deno.com with the above x-deno-ray.

跑deno deploy时报错,请问签名是怎么弄的呢

gukingle commented 6 months ago

上面签名解决了

xeno993 commented 6 months ago

上面签名解决了

老哥怎么解决的

imsoso commented 6 months ago

1、DENO_ENV: production DENO_已经变成官方预设字了 我改成了WORKER_ENV

2、https://rethinkdns.com/似乎已经被墙

Ruth-Seven commented 6 months ago

🆒

airene commented 6 months ago

赞,好专业

Van-opss commented 5 months ago

免费自建DNS这段看不懂,想自己试试没试成,确实也没怎么用过,界面也和你文字上表达的不一样,期待能有个视频什么的。点赞。

46319943 commented 5 months ago

非常好的文章!不仅展示了最佳的DNS配置实践,并且还一步步地说明了如何从最简单的配置到最佳最实用的配置,而且其中的原理都说得很清楚,清晰易懂。赞!

ypxun commented 4 months ago

meta核的default-nameserver支持dot,官方文档里有写。