Comments (11)
可以在 GitHub 搜索下 openwrt mosdns luci 的配置文件,resp_ip
+ black_hole
它是工作的
from mosdns.
可以在 GitHub 搜索下 openwrt mosdns luci 的配置文件,
resp_ip
+black_hole
它是工作的
那你可以尝试将图片中的“Cloudflare IP 范围”设置为只有 IPv4 或 IPv6 再试一试。
from mosdns.
匹配范围 ipv4 only,这测试结果应该是对的吧。因为匹配 resp_ip
的 ipv4 地址,那么理所当然的也是更替应答结果的 ipv4 地址。
如果它连同 ipv6 也被更替了,我会觉得它是一个 bug。@IrineSistiana @sbwml 大佬们是不是这样的?
from mosdns.
匹配范围 ipv4 only,这测试结果应该是对的吧。因为匹配
resp_ip
的 ipv4 地址,那么理所当然的也是更替应答结果的 ipv4 地址。如果它连同 ipv6 也被更替了,我会觉得它是一个 bug。
按照你的说法,如果我只匹配 IPv6 地址,是不是应该只替换 IPv6 地址,而不替换 IPv4 地址?但是 mosdns 并没有这样工作,你可以再试一试。
from mosdns.
1、A记录和AAAA记录是不同的qtype,他们的查询并不在同一个请求里面。
2、// Response returns a response with given ips if query has corresponding qtypes.
// Otherwise, it returns nil.
如果提供了blackhole的地址,就会替换,否则不替换。
from mosdns.
3、如果说可能的bug的话,在Match方法里面,::/0是包含了0.0.0.0/0,0.0.0.0/0不包含::/0。
而Contains是先把IP统一转换成IPv6格式再匹配:
// Contains reports whether the list includes the given netip.Addr.
func (list *List) Contains(addr netip.Addr) bool {
if !list.sorted {
panic("list is not sorted")
}
if !addr.IsValid() {
return false
}
addr = to6(addr)
i, j := 0, len(list.e)
for i < j {
h := int(uint(i+j) >> 1) // avoid overflow when computing h
if list.e[h].Addr().Compare(addr) <= 0 {
i = h + 1
} else {
j = h
}
}
if i == 0 {
return false
}
return list.e[i-1].Contains(addr)
}
所以这也算不上bug,如果你想匹配全部AAAA记录,应该用qtype 28
更高效。
from mosdns.
所以这也算不上bug,如果你想匹配全部AAAA记录,应该用
qtype 28
更高效。
- matches:
- qtype 1
- has_wanted_ans
- resp_ip $cloudflare_ip
exec: jump blackhole_cloudflare
- matches:
- qtype 28
- has_wanted_ans
- resp_ip $cloudflare_ipv6
exec: jump blackhole_cloudflare_ipv6
这样写的话,能实现如果原来是 IPv4 only / IPv4 only / dual stack,替换后也是。
但是如何实现 prefer_ipv4?因为我希望只对命中规则的域名(在这里就是使用 CF CDN 的域名)实施 prefer_ipv4,其他的保留 IPv6。而 prefer_ipv4 只能放在 forward 之前,还没有请求上游前并不知道它是不是用了Cloudflare CDN。
from mosdns.
“使用 CF CDN 的域名实施 prefer_ipv4",那你直接把解析结果命中 CF V6 CDN 的请求reject掉不就好了……
1、A记录和AAAA记录是不同的qtype,他们的查询并不在同一个请求里面。
from mosdns.
这样会影响只返回 AAAA 而没有 A 记录的域名,虽然这样的域名应该不多。正因为不是同一个请求,才不好实现。
from mosdns.
纯v6 cf cdn的域名。不能说不多,只能说除非是故意的。
from mosdns.
Related Issues (20)
- [Feature request] 保存请求的域名 & 动态追加域名到 `domain_set` HOT 2
- [Feature request] 希望增加 ecs 内建匹配器
- [Bug] 日志里的 域名 显示问题 HOT 1
- [Bug] 遇到有CNAME記錄無A/AAAA的返回可能會出現SERVFAIL
- [Bug] 群晖DSM 7.2 ( Linux 3.10)上运行报错ERROR udp get dst address from oob HOT 1
- [Bug] mosdns linux mipsle softfloat 无法监听UDP端口 HOT 1
- [Bug] Linux kernel 3.4 无法监听UDP端口 HOT 7
- [Bug] V5.3.1 数据库更新失败,提示“请检查网络状态”
- [Bug] HOT 1
- [Bug] 日志有错误信息提示无法写入缓存?
- 配置文件中的“中文域名”不识别 HOT 1
- [Bug] AAAA QTYPE 大量出现 context deadline exceeded HOT 2
- [Bug] 当其他DNS服务器的解析请求转发到mosdns上之后,无法得到解析回复 HOT 1
- DNS解锁失效
- [Feature request] 希望增加 ipset 删除功能 HOT 1
- [Bug] IPv6 DNS Server [2620:fe::fe] 识别问题 HOT 2
- [Feature request] 希望fallback插件内標記的mark可以帶回上級sequence
- [Bug] 配置文件为 wiki 中的简单转发器配置文件,mosdns 无法正常工作 HOT 2
- [Feature request] 提供将lazy_cache写入内存的选项 HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mosdns.