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

V5.3.1 自定义名单规则无效? #186

Closed
qqrate opened this issue Jan 15, 2024 · 1 comment
Closed

V5.3.1 自定义名单规则无效? #186

qqrate opened this issue Jan 15, 2024 · 1 comment

Comments

@qqrate
Copy link

qqrate commented Jan 15, 2024

请教各位,openwrt23.05 ,如题,参照default config,使用自定义配置,在openwrt上配合openclash使用,53转发至5335,能正常解析分流,但最近在切换节点时看小说网站(国内可直连)时,发现节点IP被网站ban,遂将该网站加入至whitelist,清除cache重启后仍无效,nslookup结果看,local_sequence也能正常获取到DNS。
尝试:为确认问题,将speedtest.net也加入whitelist,也是显示代理IP?
照抄默认配置的whitelist,看不出有逻辑问题啊,特来请教是哪里出错了?还是说在openwrt上运行有问题?

配置如下
log:
level: info
file: "/tmp/mosdns.log"
api:
http: "127.0.0.1:9091"

plugins:

  • tag: geosite_cn
    type: domain_set
    args:
    files:
    - "/var/mosdns/GeoSite_cn.txt"

  • tag: geoip_cn
    type: ip_set
    args:
    files:
    - "/var/mosdns/GeoIP_cn.txt"

  • tag: geosite_no_cn
    type: domain_set
    args:
    files:
    - "/var/mosdns/GeoSite_geolocation-!cn.txt"

- tag: whitelist
type: domain_set
args:
files:
- "/etc/mosdns/rule/whitelist.txt"

  • tag: blocklist
    type: domain_set
    args:
    files:
    - "/etc/mosdns/rule/blocklist.txt"

  • tag: hosts
    type: hosts
    args:
    files:
    - "/etc/mosdns/rule/hosts.txt"

  • tag: redirect
    type: redirect
    args:
    files:
    - "/etc/mosdns/rule/redirect.txt"

  • tag: greylist
    type: domain_set
    args:
    files:
    - "/etc/mosdns/rule/greylist.txt"

  • tag: adlist
    type: domain_set
    args:
    files:
    - "/etc/mosdns/rule/adlist.txt"

  • tag: cache
    type: cache
    args:
    size: 20480
    lazy_cache_ttl: 0
    dump_file: "/etc/mosdns/cache.dump"
    dump_interval: 43200

  • tag: forward_local
    type: forward
    args:
    concurrent: 2
    upstreams:
    #- addr: "udp://223.5.5.5" #阿里
    - addr: "221.5.88.88" #本地运营商DNS服务器1
    - addr: "https://1.12.12.12/dns-query" #腾讯DOH
    - addr: "116.116.116.116"
    - addr: "https://dns.alidns.com/dns-query"

  • tag: forward_remote
    type: forward
    args:
    concurrent: 3
    upstreams:

    • addr: "127.127.127.127:7874" #转发至openclash
    • addr: "https://dns.google/dns-query"
      dial_addr: "8.8.8.8"
      bootstrap: "8.8.8.8"
      bootstrap_version: 4
      idle_timeout: 30
      enable_pipeline: false
      enable_http3: false
      insecure_skip_verify: false
      so_mark: 0
      bind_to_device: ""
      #- addr: "tcp://8.8.8.8"
    • addr: "8.8.8.8"
      enable_pipeline: true
  • tag: local_sequence
    type: sequence
    args:

    • exec: $forward_local
  • tag: remote_sequence
    type: sequence
    args:

    • exec: prefer_ipv4
    • exec: $forward_remote
  • tag: has_resp_sequence
    type: sequence
    args:

    • matches: has_resp
      exec: accept
  • tag: query_is_local_ip
    type: sequence
    args:

    • exec: $local_sequence
    • matches: "!resp_ip"
      exec: drop_resp
  • tag: query_is_remote
    type: sequence
    args:

    • exec: $remote_sequence
  • tag: fallback
    type: fallback
    args:
    #primary: query_is_local_ip
    primary: query_is_remote
    secondary: query_is_remote
    threshold: 150
    always_standby: true

  • tag: query_is_local_domain
    type: sequence
    args:

    • matches: qname $geosite_cn
      exec: $local_sequence
  • tag: query_is_no_local_domain
    type: sequence
    args:

    • matches: qname $geosite_no_cn
      exec: $remote_sequence

- tag: query_is_whitelist_domain
type: sequence
args:
- matches: qname $whitelist
exec: $forward_local

  • tag: query_is_greylist_domain
    type: sequence
    args:

    • matches: qname $greylist
      exec: $remote_sequence
  • tag: query_is_reject_domain
    type: sequence
    args:

    • matches: qname $blocklist
      exec: reject 3
    • matches: qname $adlist
      exec: reject 3
    • matches:
      • qtype 12
        exec: reject 3
    • matches: qtype 65
      exec: reject 3
  • tag: main_sequence
    type: sequence
    args:

    • exec: $hosts
    • exec: jump has_resp_sequence
    • exec: $redirect
    • exec: jump has_resp_sequence
    • exec: $query_is_whitelist_domain
    • exec: jump has_resp_sequence
    • exec: $query_is_reject_domain
    • exec: $cache
    • exec: $query_is_greylist_domain
    • exec: jump has_resp_sequence
    • exec: $query_is_local_domain
    • exec: jump has_resp_sequence
    • exec: $query_is_no_local_domain
    • exec: jump has_resp_sequence
    • exec: $fallback
  • tag: udp_server
    type: udp_server
    args:
    entry: main_sequence
    listen: "127.0.0.1:5335"

  • tag: tcp_server
    type: tcp_server
    args:
    entry: main_sequence
    listen: "127.0.0.1:5335"

@sbwml
Copy link
Owner

sbwml commented Jan 15, 2024

#184

mosdns 可以决定让域名使用哪一个DNS 进行解析,但仅仅是解析。它与科学软件分流完全不搭边。科学的风流是代理层面的分流,它由ip 决定是否进行代理。

而 mosdns 的域名解析分流无法决定科学代理的进行。

参考问题 184

@sbwml sbwml closed this as not planned Won't fix, can't repro, duplicate, stale Jan 16, 2024
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

No branches or pull requests

2 participants