metasdns

command module
v0.0.0-...-406c194 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 10, 2022 License: Apache-2.0 Imports: 9 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

MetasDNS

MetasDNS 是基于 CoreDNS 开发的 DNS 服务器

功能特性

  • 通过标签模式管理域名,网络地址,通过标签快速匹配
  • 支持通过文件或远程链接加载数据配置
  • 内嵌管理界面,提供配置编辑管理, 可视化仪表盘
  • 支持查询域名匹配, 客户端Ip匹配, 查询结果 Cname, IP匹配, 支持标签反相匹配
  • 支持多个DNS上游服务器负载, 并支持上游分组分流
  • 支持强制设置 ENDS Subnet
  • 内嵌 API 服务,支持数据发布

编译发布

docker 发布

make fastpub

linux 二进制发布

make build

配置文件

.:53 {
    cache 30
    debug

    datahub {
        bootstrap 114.114.114.114:53 # 引导 DNS
        jwt_secret 9b6de5cc-vcty-4bf1-zpms-0f568ac9da37
        geoip_path conf/geoip.dat
        geosite_path conf/geosite.dat
        geoip_cache cn hk jp google apple
        geosite_cache cn hk jp private apple
        geodat_upgrade_url http://teamsacs.mydomain.cn/geodat
        geodat_upgrade_cron 0 30 0 * * *
        # datatables conf/datatables.txt
        keyword_table  cn,google  conf/keywords.txt
        domain_table  cn,aliyun,ads  conf/domains.txt
        netlist_table  cn,aliyun,local,office  conf/networks.txt
        ecs_table  global  conf/ecs_table.txt
        datapub_listen :9800
        notify_server  https://teamsacs.appsway.cn
        reload @every 3s
    }

    # 仪表盘配置
    dashboard {
        appid dashboard
        workdir /var/metasdns
        user mdns
        passwd mdns
        host 0.0.0.0
        port 9900
        secret xxxxx
        debug
    }

    # 匹配所有 CN 域名
    metadnsq cn {
        debug
        max_fails 3
        health_check 30s
        to t1 114.114.114.114 223.5.5.5 # 转发 DNS 上游
        policy round_robin

        matcher {
            # 匹配客户端标签
            client_ips office
            # 强制覆盖 ECSIP, ecsip 从 global 标签匹配
            force_ecs global
        }

        # 广告域名拦截
        matcher  {
            query_names ads
            ipset danger
            nxdomain
            notify ads
        }
    }

    # 非 CN 域名
    metadnsq !cn {
        debug
        bootstrap 114.114.114.114:53 # 引导 DNS
        max_fails 3
        health_check 30s
        to t1 8.8.8.8 9.9.9.9
        policy round_robin

        # 广告域名拦截
        matcher  {
            query_names ads
            ipset danger
            nxdomain
            notify ads
        }
    }
}

systemd 服务部署

执行 sudo sh install.sh

docker install

version: "2"
services:
  metasdns:
    image: toughstruct/metasdns
    container_name: "metasdns"
    ports:
      - "53:53/udp"
      - "53:53"
      - "9800:9800"
      - "9900:9900"
    volumes:
      - /data/metasdns:/var/metasdns
    networks:
      metasdns_network:

networks:
  metasdns_network:

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
⌂ 换网址