Comments (7)
光是这个问题的话我还能通过升级到 v0.23.0 版本解决,但是就像上面配置文件展示的那样,sequence 路由插件里存在下面这样两个匹配条件:
其中前一个可以改写成 if,if_and,exec,goto
的形式。但是第二个因为需要先尝试解析一次,才能匹配第二个匹配条件(if(response_has_bogus_ip)
),因此只能写成 if,exec,if,exec,go
的形式。
这是我为什么要提出这个 issue 的主要原因,因为从结果来看我目前的这个写法根本不起效果。
- if:
- query_is_non_local_domain
exec:
- forward_nextdns
- if:
- match_aaaa
exec:
- _drop_response
goto: _end
和
- if:
- query_is_local_domain
exec:
- with_fallback_cn_dns_serv
- if:
- response_has_bogus_ip
exec:
- _drop_response
goto: _end
from mosdns.
看 debug log。match_aaaa
返回了什么 ?
from mosdns.
没理解你的问题。是 match_aaaa 没生效,还是什么?
from mosdns.
看 debug log。
match_aaaa
返回了什么 ?
日志完全没有有用的信息,不然我一开始就会提供了。
下面是日志级别设置到 debug 级别的输出,我把整个目录复制了一份,调整了一下监听的端口复现问题。所以日志显示第一次启动失败了,但是除此以外就没有任何可以指示问题的输出。
time="2021-01-03T16:31:51+08:00" level=info msg="loading plugin my_server"
time="2021-01-03T16:31:51+08:00" level=info msg="loading plugin main_pipeline"
time="2021-01-03T16:31:51+08:00" level=info msg="loading plugin main_sequence"
time="2021-01-03T16:31:51+08:00" level=info msg="loading plugin cloak_hosts"
time="2021-01-03T16:31:51+08:00" level=info msg="loading plugin set_ecs"
time="2021-01-03T16:31:51+08:00" level=info msg="loading plugin with_fallback_cn_dns_serv"
time="2021-01-03T16:31:51+08:00" level=info msg="loading plugin plain_req_pku_and_tuna"
time="2021-01-03T16:31:51+08:00" level=info msg="loading plugin forward_ali_and_tx"
time="2021-01-03T16:31:51+08:00" level=info msg="loading plugin forward_nextdns"
time="2021-01-03T16:31:51+08:00" level=info msg="loading plugin query_is_local_domain"
time="2021-01-03T16:31:51+08:00" level=fatal msg="plugin my_server reported a fatal err: server exited with err: listen tcp 127.0.0.1:3000: bind: Only one usage of each socket address (protocol/network address/port) is normally permitted."
time="2021-01-03T16:32:09+08:00" level=info msg="loading plugin my_server"
time="2021-01-03T16:32:09+08:00" level=info msg="loading plugin main_pipeline"
time="2021-01-03T16:32:09+08:00" level=info msg="loading plugin main_sequence"
time="2021-01-03T16:32:09+08:00" level=info msg="loading plugin cloak_hosts"
time="2021-01-03T16:32:09+08:00" level=info msg="loading plugin set_ecs"
time="2021-01-03T16:32:09+08:00" level=info msg="loading plugin with_fallback_cn_dns_serv"
time="2021-01-03T16:32:09+08:00" level=info msg="loading plugin plain_req_pku_and_tuna"
time="2021-01-03T16:32:09+08:00" level=info msg="loading plugin forward_ali_and_tx"
time="2021-01-03T16:32:09+08:00" level=info msg="loading plugin forward_nextdns"
time="2021-01-03T16:32:09+08:00" level=info msg="loading plugin query_is_local_domain"
time="2021-01-03T16:32:09+08:00" level=info msg="loading plugin query_is_non_local_domain"
time="2021-01-03T16:32:09+08:00" level=info msg="loading plugin query_is_ad_domain"
time="2021-01-03T16:32:09+08:00" level=info msg="loading plugin match_aaaa"
time="2021-01-03T16:32:09+08:00" level=info msg="loading plugin response_has_bogus_ip"
time="2021-01-03T16:32:09+08:00" level=info msg="all plugins are successfully loaded"
time="2021-01-03T16:32:09+08:00" level=debug msg="loaded plugins: [_block_with_servfail _query_is_common my_server _default_cache _drop_response _block_with_nxdomain _end with_fallback_cn_dns_serv plain_req_pku_and_tuna query_is_non_local_domain match_aaaa _no_ecs _qtype_A_AAAA _response_rcode_success main_pipeline main_sequence query_is_local_domain response_has_bogus_ip my_logger cloak_hosts set_ecs forward_ali_and_tx forward_nextdns query_is_ad_domain]"
time="2021-01-03T16:32:24+08:00" level=debug msg="HeapObjects: 446609 NumGC: 6 PauseTotalNs: 1016900, NumGoroutine: 9"
time="2021-01-03T16:32:39+08:00" level=debug msg="HeapObjects: 446628 NumGC: 6 PauseTotalNs: 1016900, NumGoroutine: 9"
time="2021-01-03T16:32:54+08:00" level=debug msg="HeapObjects: 446648 NumGC: 6 PauseTotalNs: 1016900, NumGoroutine: 9"
time="2021-01-03T16:33:09+08:00" level=debug msg="HeapObjects: 446674 NumGC: 6 PauseTotalNs: 1016900, NumGoroutine: 9"
没理解你的问题。是 match_aaaa 没生效,还是什么?
是的,感觉 match_aaaa 没生效,因为我几乎可以肯定域名解析过程中进入了 non_local_domain 的分支,但是对 www.facebook.com 解析返回了 IPv6 地址。
from mosdns.
你确定你的请求是 mosdns 处理的么.....
不管怎么样,只要收到请求,mosdns 就有 log 的,不可能漏。
from mosdns.
你确定你的请求是 mosdns 处理的么.....
不管怎么样,只要收到请求,mosdns 就有 log 的,不可能漏。
那确实很奇怪……我吸取上次的教训,这次是开了 ps 以后打开 nslookup 测试的。
nslookup
> set port=5454
> set server=127.0.0.2
> set type=a+aaaa
> www.facebook.com
from mosdns.
重启解决问题了……感觉大概是缓存的锅。
from mosdns.
Related Issues (20)
- [Bug] 在经过 resp_ip 判断后 black_hole 无法替换 IPv4 或 IPv6 地址 HOT 11
- [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
- [Feature request] prefer plugin support for HTTPS record HOT 1
- [Bug] client_ip匹配ipv6 cidr未按预期工作 HOT 2
- [Feature request] 丢弃resp_ip中指定的IP
- [Feature request] 并行请求时直接返回最快返回的应答 HOT 1
- [Feature request] 关于 forward 和 hosts 插件的功能建议! HOT 4
- 用sequence模拟fallback,出现context deadline exceeded时程序会中断。 HOT 4
- [Bug] has invalid keys: data_providers, servers HOT 1
- [Feature request] 可以支持直接读取xray的geosite.dat文件么 HOT 3
- [Bug] prefer_ipv4 是否有bug,影响到了纯 ipv6 解析 HOT 1
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.