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

mosdns5.3.3 自定义配置无法启动 #261

Open
Yumega opened this issue Oct 3, 2024 · 5 comments
Open

mosdns5.3.3 自定义配置无法启动 #261

Yumega opened this issue Oct 3, 2024 · 5 comments

Comments

@Yumega
Copy link

Yumega commented Oct 3, 2024

使用内置配置可以启动,正常运行
使用自定义配置显示错误

2024-10-03 15:29:45	INFO	unpacking entry	{"tag": "cn", "length": 19021, "file": "/var/mosdns/geoip_cn.txt"}
2024-10-03 15:29:45	INFO	unpacking entry	{"tag": "cn", "length": 90165, "file": "/var/mosdns/geosite_cn.txt"}
2024-10-03 15:29:45	INFO	unpacking entry	{"tag": "geolocation-!cn", "length": 30975, "file": "/var/mosdns/geosite_geolocation-!cn.txt"}
2024-10-03 15:29:45	INFO	loading plugin	{"tag": "geosite_cn", "type": "domain_set"}
2024-10-03 15:29:45	INFO	starting api http server	{"addr": "0.0.0.0:9092"}
2024-10-03 15:29:46	INFO	loading plugin	{"tag": "geoip_cn", "type": "ip_set"}
2024-10-03 15:29:46	INFO	loading plugin	{"tag": "geosite_apple", "type": "domain_set"}
2024-10-03 15:29:46	INFO	starting shutdown sequences
2024-10-03 15:29:46	INFO	all plugins were closed
@Yumega
Copy link
Author

Yumega commented Oct 3, 2024

没发现自定义配置错误

log:
  level: info
  file: "/var/log/mosdns.log"

api:
  http: "0.0.0.0:9092"

include: []

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_apple
    type: domain_set
    args:
      files:
        - "/var/mosdns/geosite_apple.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: greylist
    type: domain_set
    args:
      files:
        - "/etc/mosdns/rule/greylist.txt"

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

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

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

  - tag: adlist
    type: domain_set
    args:
      files:
        - "/var/disable-ads.txt"

  - tag: local_ptr
    type: domain_set
    args:
      files:
        - "/etc/mosdns/rule/local-ptr.txt"

  - tag: cloudflare_cidr
    type: ip_set
    args:
      files:
        - "/etc/mosdns/rule/cloudflare-cidr.txt"

  - tag: lazy_cache
    type: cache
    args:
      size: 0
      lazy_cache_ttl: 0

  - tag: forward_xinfeng_udp
    type: forward
    args:
      concurrent: 1
      upstreams:
        - addr: "114.114.114.114"

  - tag: forward_local
    type: forward
    args:
      concurrent: 3
      upstreams:
        - addr: "221.179.38.7"    # 广东移动
          enable_pipeline: false
        - addr: "tls://dns.alidns.com"
          bootstrap: 223.6.6.6
          enable_pipeline: false
          insecure_skip_verify: false
          idle_timeout: 30
        - addr: "tls://dot.pub"
          bootstrap: 182.254.116.116    # DNSPod
          enable_pipeline: true
          insecure_skip_verify: false
          idle_timeout: 30

  - tag: forward_remote
    type: forward
    args:
      concurrent: 3
      upstreams:
        - addr: "tls://8.8.8.8"
          dial_addr: "8.8.8.8"
          bootstrap: "8.8.8.8"
          bootstrap_version: 4
          socks5: "127.0.0.1:10801"    # socks5代理, 有其他代理方式或者不需要代理,请删除此行
          idle_timeout: 30
          enable_pipeline: true
          enable_http3: true
          insecure_skip_verify: false
        - addr: "tls://1.1.1.1"
          dial_addr: "1.1.1.1"
          bootstrap: "1.1.1.1"
          bootstrap_version: 4
          socks5: "127.0.0.1:10801"    # socks5代理, 有其他代理方式或者不需要代理,请删除此行
          idle_timeout: 30
          enable_pipeline: true
          enable_http3: true
          insecure_skip_verify: false
        - addr: "tls://208.67.222.222"
          dial_addr: "208.67.222.222"
          bootstrap: "208.67.222.222"
          bootstrap_version: 4
          socks5: "127.0.0.1:10801"    # socks5代理, 有其他代理方式或者不需要代理,请删除此行
          idle_timeout: 30
          enable_pipeline: true
          enable_http3: true
          insecure_skip_verify: false

  - tag: forward_remote_upstream
    type: sequence
    args:
      - exec: prefer_ipv4
      - exec: $forward_remote

  - tag: modify_ttl
    type: sequence
    args:
      - exec: ttl 0-0

  - tag: modify_ddns_ttl
    type: sequence
    args:
      - exec: ttl 5-5

  - tag: has_resp_sequence
    type: sequence
    args:
      - matches: qname $ddnslist
        exec: $modify_ddns_ttl
      - matches: "!qname $ddnslist"
        exec: $modify_ttl
      - matches: has_resp
        exec: accept

  - tag: query_is_non_local_ip
    type: sequence
    args:
      - exec: $forward_local
      - matches: "!resp_ip $geoip_cn"
        exec: drop_resp

  - tag: fallback
    type: fallback
    args:
      primary: forward_remote_upstream
      secondary: forward_remote_upstream
      threshold: 500
      always_standby: true

  - tag: apple_domain_fallback
    type: fallback
    args:
      primary: query_is_non_local_ip
      secondary: forward_xinfeng_udp
      threshold: 100
      always_standby: true

  - tag: query_is_apple_domain
    type: sequence
    args:
      - matches: "!qname $geosite_apple"
        exec: return
      - exec: $apple_domain_fallback

  - tag: query_is_ddns_domain
    type: sequence
    args:
      - matches: qname $ddnslist
        exec: $forward_local

  - tag: query_is_local_domain
    type: sequence
    args:
      - matches: qname $geosite_cn
        exec: $forward_local

  - tag: query_is_no_local_domain
    type: sequence
    args:
      - matches: qname $geosite_no_cn
        exec: $forward_remote_upstream

  - 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: $forward_remote_upstream

  - tag: query_is_reject_domain
    type: sequence
    args:
      - matches: qname $blocklist
        exec: reject 3
      - matches: qname $adlist
        exec: reject 3
      - matches:
        - qtype 12
        - qname $local_ptr
        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_apple_domain
      - exec: jump has_resp_sequence
      - exec: $query_is_ddns_domain
      - exec: jump has_resp_sequence
      - exec: $query_is_whitelist_domain
      - exec: jump has_resp_sequence
      - exec: $query_is_reject_domain
      - exec: jump has_resp_sequence
      - 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: ":5336"

  - tag: tcp_server
    type: tcp_server
    args:
      entry: main_sequence
      listen: ":5336"

@Yumega
Copy link
Author

Yumega commented Oct 3, 2024

内置配置点击[已启用]会正常启用,绿色显示MosDNS 运行中
自定义配置点击[已启用],openwrt会显示
hi_21-30
点击保存和应用,点击[已启用],红色显示 MosDNS 未运行

log 错误就是一楼 all plugins were closed

@Mrican
Copy link

Mrican commented Oct 3, 2024

geosite_apple 是否有导出?

@Yumega
Copy link
Author

Yumega commented Oct 3, 2024

geosite_apple 是否有导出?

没有进行任何导出操作,因为/var/mosdns/geosite_apple.txt 在使用默认配置以后,里面apple的各种域名内容已经存在

@sbwml
Copy link
Owner

sbwml commented Oct 3, 2024 via email

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

3 participants