找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
广告投放联系QQ68610888
查看: 10892|回复: 199

OP下 MOSDNS 4.1.x 版本可用的分流配置文件

 火.. [复制链接]
发表于 2022-9-2 17:00 | 显示全部楼层 |阅读模式
只是一个配置文件备份,注意使用了cn.dat 可以替换为geoip.dat
  1. log:
  2.   level: info
  3.   file: "/tmp/mosdns.log"

  4. include: []

  5. data_providers:
  6.   - tag: geoip
  7.     file: "/etc/mosdns/cn.dat"        #使用cn.dat 高性能
  8.     auto_reload: true

  9.   - tag: geosite
  10.     file: "/etc/mosdns/geosite.dat"
  11.     auto_reload: true

  12.   - tag: whitelist
  13.     file: "/etc/mosdns/rule/whitelist.txt"
  14.     auto_reload: true

  15.   - tag: blocklist
  16.     file: "/etc/mosdns/rule/blocklist.txt"
  17.     auto_reload: true

  18.   - tag: hosts
  19.     file: "/etc/mosdns/rule/hosts.txt"
  20.     auto_reload: true

  21.   - tag: redirect
  22.     file: "/etc/mosdns/rule/redirect.txt"
  23.     auto_reload: true

  24. plugins:
  25.   - tag: lazy_cache
  26.     type: cache
  27.     args:
  28.       size: 200000
  29.       lazy_cache_ttl: 259200

  30.   - tag: modify_ttl
  31.     type: ttl
  32.     args:
  33.       minimal_ttl: 0
  34.       maximum_ttl: 0

  35.   - tag: "forward_local"
  36.     type: fast_forward
  37.     args:
  38.       upstream:
  39.         - addr: 119.29.29.29
  40.         - addr: 114.114.114.114

  41.   - tag: "forward_remote"
  42.     type: fast_forward
  43.     args:
  44.       upstream:
  45.         - addr: tls://8.8.4.4
  46.         #- addr: tls://1.1.1.1
  47.         #- addr: "https://dns.google/dns-query"
  48.         #  dial_addr: "8.8.8.8:443"
  49.         #  idle_timeout: 30
  50.         #  trusted: true
  51.         #- addr: "https://cloudflare-dns.com/dns-query"
  52.         #  dial_addr: "1.1.1.1:443"
  53.         #  idle_timeout: 30
  54.         #  trusted: true

  55.   - tag: query_is_whitelist_domain
  56.     type: query_matcher
  57.     args:
  58.       domain:
  59.         - "provider:whitelist"

  60.   - tag: query_is_blocklist_domain
  61.     type: query_matcher
  62.     args:
  63.       domain:
  64.         - "provider:blocklist"

  65.   - tag: query_is_hosts_domain
  66.     type: hosts
  67.     args:
  68.       hosts:
  69.         - "provider:hosts"

  70.   - tag: query_is_redirect_domain
  71.     type: redirect
  72.     args:
  73.       rule:
  74.         - "provider:redirect"

  75.   - tag: query_is_local_domain
  76.     type: query_matcher
  77.     args:
  78.       domain:
  79.         - "provider:geosite:cn"

  80.   - tag: query_is_non_local_domain
  81.     type: query_matcher
  82.     args:
  83.       domain:
  84.         - "provider:geosite:geolocation-!cn"

  85.   - tag: response_has_local_ip
  86.     type: response_matcher
  87.     args:
  88.       ip:
  89.         - "provider:geoip:cn"

  90.   - tag: query_is_ad_domain
  91.     type: query_matcher
  92.     args:
  93.       domain:
  94.         - "provider:geosite:category-ads-all"

  95.   - tag: match_qtype65
  96.     type: query_matcher
  97.     args:
  98.       qtype: [65]

  99.   - tag: "main_sequence"
  100.     type: "sequence"
  101.     args:
  102.       exec:
  103.         - query_is_hosts_domain
  104.         - query_is_redirect_domain

  105.         - if: query_is_whitelist_domain
  106.           exec:
  107.             - forward_local
  108.             - modify_ttl
  109.             - _return

  110.         - if: "query_is_blocklist_domain || query_is_ad_domain || match_qtype65"
  111.           exec:
  112.             - _new_nxdomain_response
  113.             - _return

  114.         - lazy_cache

  115.         - if: query_is_local_domain
  116.           exec:
  117.             - forward_local
  118.             - modify_ttl
  119.             - _return

  120.         - if: query_is_non_local_domain
  121.           exec:
  122.             - _prefer_ipv4
  123.             - forward_remote
  124.             - modify_ttl
  125.             - _return
  126.         - primary:
  127.             - forward_local
  128.             - if: "(! response_has_local_ip) && [_response_valid_answer]"
  129.               exec:
  130.                 - _drop_response
  131.           secondary:
  132.             - _prefer_ipv4
  133.             - forward_remote
  134.             - modify_ttl
  135.           fast_fallback: 200

  136. servers:
  137.   - exec: main_sequence
  138.     listeners:
  139.       - protocol: udp
  140.         addr: ":5335"
  141.       - protocol: tcp
  142.         addr: ":5335"
复制代码
我的恩山、我的无线 The best wifi forum is right here.
发表于 2022-9-3 02:16 | 显示全部楼层
就和客家话客家话
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2022-9-3 10:07 | 显示全部楼层
谢谢分享
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2022-9-3 11:16 来自手机 | 显示全部楼层
666666666
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2022-9-4 10:58 来自手机 | 显示全部楼层
66666666666
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2022-9-4 12:55 | 显示全部楼层
谢谢楼主分享
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2022-9-4 12:58 | 显示全部楼层
感谢分享
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2022-9-5 16:46 | 显示全部楼层
感谢分享
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2022-9-5 22:04 | 显示全部楼层
感谢!点点点
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2022-9-5 23:41 | 显示全部楼层
了嗯嗯拉拉汗v
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2022-9-5 23:43 | 显示全部楼层
MOSDNS 4.1.x 版本
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2022-9-5 23:43 来自手机 | 显示全部楼层
默认,不然会清空大雕的规则表
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2022-9-6 13:22 | 显示全部楼层
kanyikkan
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2022-9-8 14:25 | 显示全部楼层
感谢分享啊~!
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2022-9-9 19:56 | 显示全部楼层
看一下是什么样的
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

有疑问请添加管理员QQ86788181|手机版|小黑屋|Archiver|恩山无线论坛(常州市恩山计算机开发有限公司版权所有) ( 苏ICP备05084872号 )

GMT+8, 2024-4-24 16:21

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

| 江苏省互联网有害信息举报中心 举报信箱:js12377 | @jischina.com.cn 举报电话:025-88802724 本站不良内容举报信箱:68610888@qq.com 举报电话:0519-86695797

快速回复 返回顶部 返回列表