Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

增加 Maxmind DB 匹配器,用于匹配 response ip #643

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

alecthw
Copy link

@alecthw alecthw commented Mar 17, 2023

#554
#547

增加 Maxmind DB 匹配器,用于匹配 response ip

  1. 增加一个data_provider插件mmdb,用于指定mmdb文件
  2. 增加一个matcher插件resp_ip_mmdb,用于匹配 response ip

PS:mmdb一般情况是只有匹配DNS结果IP的需要,所以只增加了response匹配

使用示例如下:

plugins:
  - tag: country
    type: mmdb
    args:
      file: "./rules/Country.mmdb"

  - tag: main_sequence
    type: sequence
    args:
      - exec: $forward_local
      - matches: resp_ip_mmdb $country CN
        exec: query_summary CN mmdb

@alecthw
Copy link
Author

alecthw commented Mar 19, 2023

force-push

  1. 补充了mmdb.go的License文件头
  2. 调整resp_ip_mmdb.go的import格式化顺序,和整体风格保持一致

@kkkgo
Copy link

kkkgo commented Mar 30, 2023

非常好功能👍

@luweijun1992
Copy link

请问这个功能当前最新版本加上了吗?
如果还没有,什么时间会发布这个新功能?

@IrineSistiana
Copy link
Owner

Thanks for the PR.

我觉得 mmdb 的优势在于可以很方便的匹配很多数据,国家,asn等。问题是,1,完整版是付费的,2,实际使用中除了 country,其余都用不到。

所以有了精简版的 mmdb,普遍只有 cn ip,而且数据源是 cidr 表。这种情况不如直接用 cidr 表。

综上,我觉得 mosdns 引入 mmdb 作用不大。

@IrineSistiana
Copy link
Owner

如果你能维护一个插件的 repo。我可以把链接放在 wiki。

@alecthw
Copy link
Author

alecthw commented Sep 25, 2023

如果你能维护一个插件的 repo。我可以把链接放在 wiki。

国庆我看下哈^_^

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants