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

[Bug] i/o timeout #875

Open
4 tasks done
AndyLin2020 opened this issue Feb 21, 2025 · 2 comments
Open
4 tasks done

[Bug] i/o timeout #875

AndyLin2020 opened this issue Feb 21, 2025 · 2 comments

Comments

@AndyLin2020
Copy link

在提交之前,请确认

  • 我已经尝试搜索过 Issue ,但没有找到相关问题。
  • 我正在使用最新的 mosdns 版本(或者最新的 commit),问题依旧存在。
  • 我仔细看过 wiki 后仍然无法自行解决该问题。
  • 我非常确定这是 mosdns 核心的问题。(如果是通过第三方衍生软件使用 mosdns 核心,不确定问题源头时,请先向衍生软件开发者提交问题。)

mosdns 版本

v5.3.4-0-g525c394

操作系统

Debian 12

Bug 描述和复现步骤

Debian 12为旁路由,部署了AdguardHome(:53)+上游DNS服务器mosdns(:5335),AdguardHome三分钟就会出现以下三条日志,但是解析都正常,不知道哪里设置有问题?

2025/02/21 14:23:51.591288 ERROR response received addr=127.0.0.1:5335 proto=udp status="exchanging with 127.0.0.1:5335 over udp: read udp 127.0.0.1:34728->127.0.0.1:5335: i/o timeout"
2025/02/21 14:23:56.661629 ERROR response received addr=127.0.0.1:5335 proto=udp status="exchanging with 127.0.0.1:5335 over udp: read udp 127.0.0.1:30589->127.0.0.1:5335: i/o timeout"
2025/02/21 14:24:01.741718 ERROR response received addr=127.0.0.1:5335 proto=udp status="exchanging with 127.0.0.1:5335 over udp: read udp 127.0.0.1:64952->127.0.0.1:5335: i/o timeout"

使用的配置文件

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

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: hosts
    type: hosts
    args:
      files:
        - "/var/mosdns/hosts.txt"

  - tag: lazy_cache
    type: cache
    args:
      size: 51200 
      lazy_cache_ttl: 432000  
      dump_file: "/etc/mosdns/cache.dump"
      dump_interval: 1200  

  - tag: forward_local
    type: forward
    args:
      concurrent: 4
      upstreams:
        - addr: https://223.6.6.6/dns-query
          enable_pipeline: true
          insecure_skip_verify: false
          idle_timeout: 30
        - addr: https://sm2.doh.pub/dns-query
          enable_pipeline: true
          insecure_skip_verify: false
          idle_timeout: 30
        - addr: https://1.12.12.12/dns-query
          enable_pipeline: true
          insecure_skip_verify: false
          idle_timeout: 30
        - addr: https://120.53.53.53/dns-query
          enable_pipeline: true
          insecure_skip_verify: false
          idle_timeout: 30 

 
  - tag: forward_remote
    type: forward
    args:
      concurrent: 4
      upstreams:
        - addr: https://8.8.8.8/dns-query
          bootstrap: 8.8.8.8
          enable_pipeline: true
          insecure_skip_verify: false
          idle_timeout: 30
        - addr: https://8.8.4.4/dns-query
          bootstrap: 8.8.8.8
          enable_pipeline: true
          insecure_skip_verify: false
          idle_timeout: 30

        - addr: "tls://1.1.1.1:853"   
          enable_pipeline: true
          insecure_skip_verify: false
        - addr: "tls://1.0.0.1:853"
          enable_pipeline: true
          insecure_skip_verify: false
 
  - 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 $geoip_cn"
        exec: drop_resp

  - tag: query_is_remote
    type: sequence
    args:
      - exec: $remote_sequence

  - tag: fallback
    type: fallback
    args:
      primary: query_is_remote
      secondary: query_is_remote  
      threshold: 300  
      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: main_sequence
    type: sequence
    args:
      - exec: $hosts
      - exec: jump has_resp_sequence
      - exec: $lazy_cache
      - matches: qname & /var/mosdns/direct-list.txt
        exec: $forward_local
      - 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: "0.0.0.0:5335"

  - tag: tcp_server
    type: tcp_server
    args:
      entry: main_sequence
      listen: "0.0.0.0:5335"

mosdns 的 log 记录

@yyysuo
Copy link

yyysuo commented Feb 24, 2025

Adguard Home中用mosdns的tcp呗。

@AndyLin2020
Copy link
Author

Adguard Home中用mosdns的tcp呗。

改用tcp后就没那烦人的日志了

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