迫于透明代理,写了一个 dns 分流的东西

2020-04-14 18:01:21 +08:00
 pcmid

项目地址 mdns

本项目受 overture 启发

之前苦于透明代理需要拉 ip 段,和域名列表是分开的,感觉很不清蒸( 。就写了一个这样东西,将 dns 查询到的结果自动加入 ipset 中。

mdns

一个支持插件的 dns 代理工具

配置

{
  "addr": ":53",
  "upstream": {
    "name": "Google DNS",
    "address": "8.8.8.8:53",
    "protocol": "tcp",
    "socks5_address": "127.0.0.1:1080",
    "timeout": 6
  },
  "plugins": [
    {
      "name": "log",
      "config": {
        "log_file": ""
      }
    },
    {
      "name": "cache",
      "config": {
        "capacity": 1024,
        "MTTL": 3600
      }
    },
    {
      "name": "dispatcher",
      "config": {
        "areas": {
          "TEST": {
            "upstream": {
              "name": "114 DNS",
              "address": "114.114.114.114:53",
              "protocol": "udp",
              "socks5_address": "",
              "timeout": 6
            },
            "domain_file": "config.sample.d/domain_test.txt"
          }
        }
      }
    },
    {
      "name": "ipset",
      "config": {
        "sets": {
          "TEST": {
            "domain_file": "config.sample.d/domain_test.txt",
            "ip_file": "config.sample.d/ip_test.txt"
          }
        }
      }
    }
  ]
}


插件

log

支持简单的查询日志记录

cache

缓存 最大缓存数量capacity和最小 ttl MTTL

dispatcher

分流器,通过匹配domain_file执行分流策略,选择不同的上游

ipset

根据domain_file将查询到的 ip 插入 ipset 中,暂未支持ip_file

839 次点击
所在节点    分享创造
1 条回复
missdeer
2020-04-15 09:35:10 +08:00

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/662377

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX