IrineSistiana / mosdns

一个 DNS 转发器
GNU General Public License v3.0
2.85k stars 324 forks source link

[BUG]日志里会出现 deps 的信息 #208

Closed Hades-001 closed 2 years ago

Hades-001 commented 2 years ago

出现了什么问题

简要描述一下问题的表现,以及执行了什么操作导致了问题的出现:

日志里会出现 deps 的信息,其中的一段:

2021-11-20T23:45:41.134+0800    warn    forward_remote  bundled_upstream/bundled_upstream.go:91 upstream failed {"query": "95.ucp-ntfy.kaspersky-labs.com. IN A 48664 137 127.0.0.1:59171", "from": "tls://8.8.8.8:853", "error": "Failed to get a connection from TLSPool to tls://8.8.8.8:853, cause: Failed to connect to 8.8.8.8, cause: all dialers failed to initialize connection: , cause: dial tcp 8.8.8.8:853: connectex: A socket operation was attempted to an unreachable network.", "errorVerbose": "Failed to get a connection from TLSPool to tls://8.8.8.8:853, cause: Failed to connect to 8.8.8.8, cause: all dialers failed to initialize connection: , cause: dial tcp 8.8.8.8:853: connectex: A socket operation was attempted to an unreachable network.\n at github.com/joomcode/errorx.WrapMany()\n\tgithub.com/joomcode/errorx@v1.0.3/wrap.go:82\n at github.com/joomcode/errorx.DecorateMany()\n\tgithub.com/joomcode/errorx@v1.0.3/wrap.go:68\n at github.com/AdguardTeam/dnsproxy/upstream.(*bootstrapper).createDialContext.func1()\n\tgithub.com/AdguardTeam/dnsproxy@v0.39.10/upstream/bootstrap.go:252\n at github.com/AdguardTeam/dnsproxy/upstream.tlsDial()\n\tgithub.com/AdguardTeam/dnsproxy@v0.39.10/upstream/upstream_pool.go:95\n at github.com/AdguardTeam/dnsproxy/upstream.(*TLSPool).Create()\n\tgithub.com/AdguardTeam/dnsproxy@v0.39.10/upstream/upstream_pool.go:75\n at github.com/AdguardTeam/dnsproxy/upstream.(*TLSPool).Get()\n\tgithub.com/AdguardTeam/dnsproxy@v0.39.10/upstream/upstream_pool.go:64\n at github.com/AdguardTeam/dnsproxy/upstream.(*dnsOverTLS).Exchange()\n\tgithub.com/AdguardTeam/dnsproxy@v0.39.10/upstream/upstream_dot.go:40\n at github.com/IrineSistiana/mosdns/v2/dispatcher/plugin/executable/forward.(*trustedUpstream).Exchange()\n\tgithub.com/IrineSistiana/mosdns/v2/dispatcher/plugin/executable/forward/forward.go:134\n at github.com/IrineSistiana/mosdns/v2/dispatcher/pkg/bundled_upstream.(*BundledUpstream).ExchangeParallel.func1()\n\tgithub.com/IrineSistiana/mosdns/v2/dispatcher/pkg/bundled_upstream/bundled_upstream.go:77\n at runtime.goexit()\n\truntime/asm_amd64.s:1581"}
2021-11-20T23:45:41.134+0800    warn    forward_remote  bundled_upstream/bundled_upstream.go:91 upstream failed {"query": "95.ucp-ntfy.kaspersky-labs.com. IN A 48664 137 127.0.0.1:59171", "from": "tls://8.8.4.4:853", "error": "Failed to get a connection from TLSPool to tls://8.8.4.4:853, cause: Failed to connect to 8.8.4.4, cause: all dialers failed to initialize connection: , cause: dial tcp 8.8.4.4:853: connectex: A socket operation was attempted to an unreachable network.", "errorVerbose": "Failed to get a connection from TLSPool to tls://8.8.4.4:853, cause: Failed to connect to 8.8.4.4, cause: all dialers failed to initialize connection: , cause: dial tcp 8.8.4.4:853: connectex: A socket operation was attempted to an unreachable network.\n at github.com/joomcode/errorx.WrapMany()\n\tgithub.com/joomcode/errorx@v1.0.3/wrap.go:82\n at github.com/joomcode/errorx.DecorateMany()\n\tgithub.com/joomcode/errorx@v1.0.3/wrap.go:68\n at github.com/AdguardTeam/dnsproxy/upstream.(*bootstrapper).createDialContext.func1()\n\tgithub.com/AdguardTeam/dnsproxy@v0.39.10/upstream/bootstrap.go:252\n at github.com/AdguardTeam/dnsproxy/upstream.tlsDial()\n\tgithub.com/AdguardTeam/dnsproxy@v0.39.10/upstream/upstream_pool.go:95\n at github.com/AdguardTeam/dnsproxy/upstream.(*TLSPool).Create()\n\tgithub.com/AdguardTeam/dnsproxy@v0.39.10/upstream/upstream_pool.go:75\n at github.com/AdguardTeam/dnsproxy/upstream.(*TLSPool).Get()\n\tgithub.com/AdguardTeam/dnsproxy@v0.39.10/upstream/upstream_pool.go:64\n at github.com/AdguardTeam/dnsproxy/upstream.(*dnsOverTLS).Exchange()\n\tgithub.com/AdguardTeam/dnsproxy@v0.39.10/upstream/upstream_dot.go:40\n at github.com/IrineSistiana/mosdns/v2/dispatcher/plugin/executable/forward.(*trustedUpstream).Exchange()\n\tgithub.com/IrineSistiana/mosdns/v2/dispatcher/plugin/executable/forward/forward.go:134\n at github.com/IrineSistiana/mosdns/v2/dispatcher/pkg/bundled_upstream.(*BundledUpstream).ExchangeParallel.func1()\n\tgithub.com/IrineSistiana/mosdns/v2/dispatcher/pkg/bundled_upstream/bundled_upstream.go:77\n at runtime.goexit()\n\truntime/asm_amd64.s:1581"}
2021-11-20T23:45:41.134+0800    warn    forward_remote  bundled_upstream/bundled_upstream.go:91 upstream failed {"query": "95.ucp-ntfy.kaspersky-labs.com. IN A 48664 137 127.0.0.1:59171", "from": "tls://1.0.0.1:853", "error": "Failed to get a connection from TLSPool to tls://1.0.0.1:853, cause: Failed to connect to 1.0.0.1, cause: all dialers failed to initialize connection: , cause: dial tcp 1.0.0.1:853: connectex: A socket operation was attempted to an unreachable network.", "errorVerbose": "Failed to get a connection from TLSPool to tls://1.0.0.1:853, cause: Failed to connect to 1.0.0.1, cause: all dialers failed to initialize connection: , cause: dial tcp 1.0.0.1:853: connectex: A socket operation was attempted to an unreachable network.\n at github.com/joomcode/errorx.WrapMany()\n\tgithub.com/joomcode/errorx@v1.0.3/wrap.go:82\n at github.com/joomcode/errorx.DecorateMany()\n\tgithub.com/joomcode/errorx@v1.0.3/wrap.go:68\n at github.com/AdguardTeam/dnsproxy/upstream.(*bootstrapper).createDialContext.func1()\n\tgithub.com/AdguardTeam/dnsproxy@v0.39.10/upstream/bootstrap.go:252\n at github.com/AdguardTeam/dnsproxy/upstream.tlsDial()\n\tgithub.com/AdguardTeam/dnsproxy@v0.39.10/upstream/upstream_pool.go:95\n at github.com/AdguardTeam/dnsproxy/upstream.(*TLSPool).Create()\n\tgithub.com/AdguardTeam/dnsproxy@v0.39.10/upstream/upstream_pool.go:75\n at github.com/AdguardTeam/dnsproxy/upstream.(*TLSPool).Get()\n\tgithub.com/AdguardTeam/dnsproxy@v0.39.10/upstream/upstream_pool.go:64\n at github.com/AdguardTeam/dnsproxy/upstream.(*dnsOverTLS).Exchange()\n\tgithub.com/AdguardTeam/dnsproxy@v0.39.10/upstream/upstream_dot.go:40\n at github.com/IrineSistiana/mosdns/v2/dispatcher/plugin/executable/forward.(*trustedUpstream).Exchange()\n\tgithub.com/IrineSistiana/mosdns/v2/dispatcher/plugin/executable/forward/forward.go:134\n at github.com/IrineSistiana/mosdns/v2/dispatcher/pkg/bundled_upstream.(*BundledUpstream).ExchangeParallel.func1()\n\tgithub.com/IrineSistiana/mosdns/v2/dispatcher/pkg/bundled_upstream/bundled_upstream.go:77\n at runtime.goexit()\n\truntime/asm_amd64.s:1581"}

mosdns 的 log 记录:

mosdns.zip

环境

描述一下问题出现的环境,便于复现以更快定位问题。必须包含:

mosdns 的版本号(mosdns -v):v2.1.2

操作系统和平台:LTSC 2021 x64 19044.1348

使用的配置文件:

log:
  level: warn
  file: "./mosdns.log"

plugin:
  - tag: main_server
    type: server
    args:
      entry:
        - hosts
        - cache
        - main_sequence
      max_concurrent_queries: 0
      server:
        - protocol: udp
          addr: 127.0.0.1:53
        - protocol: tcp
          addr: 127.0.0.1:53

  - tag: main_sequence
    type: sequence
    args:
      exec:
        - if:
            - query_is_ad_domain
          exec:
            - _block_with_nxdomain
            - _end
        - if:
            - _qtype_AAAA
          exec:
            - _block_with_empty_response
            - _end
        - if:
            - query_is_local_domain
            - "!_query_is_common"
          exec:
            - forward_local
            - _end
        - if:
            - query_is_non_local_domain
          exec:
            - forward_remote
            - _end
        - primary:
            - forward_local
            - if:
                - "!response_has_local_ip"
              exec:
                - _drop_response
          secondary:
            - forward_remote
          fast_fallback: 200
          always_standby: true

  - tag: hosts
    type: hosts
    args:
      hosts:
        - "ext:./hosts"

  - tag: cache
    type: cache
    args:
      size: 4096
      lazy_cache_ttl: 86400
      lazy_cache_reply_ttl: 30

  - tag: forward_local
    type: forward
    args:
      upstream:
        - addr: tcp://223.5.5.5:53
          trusted: false
        - addr: tcp://119.29.29.29:53
          trusted: false
      bootstrap:
        - tls://223.5.5.5
        - tls://223.6.6.6
      timeout: 10
      insecure_skip_verify: false
      fastest_ip: false

  - tag: forward_remote
    type: forward
    args:
      upstream:
        - addr: tls://8.8.8.8
          trusted: true
        - addr: tls://8.8.4.4
          trusted: true
        - addr: tls://1.1.1.1
          trusted: true
        - addr: tls://1.0.0.1
          trusted: true
        - addr: tcp://208.67.222.222:5353
          trusted: true
        - addr: tcp://208.67.220.220:5353
          trusted: true
        - addr: https://dns11.quad9.net/dns-query
          ip_addr:
            - "9.9.9.9"
            - "149.112.112.112"
          trusted: true
      bootstrap:
        - tls://223.5.5.5
        - tls://223.6.6.6
      timeout: 10
      insecure_skip_verify: false
      fastest_ip: false

  - tag: query_is_local_domain
    type: query_matcher
    args:
      domain:
        - "ext:./geosite.dat:cn"

  - tag: query_is_non_local_domain
    type: query_matcher
    args:
      domain:
        - "ext:./geosite.dat:geolocation-!cn"

  - tag: query_is_ad_domain
    type: query_matcher
    args:
      domain:
        - "ext:./geosite.dat:category-ads-all"

  - tag: response_has_local_ip
    type: response_matcher
    args:
      ip:
        - "ext:./geoip.dat:cn"
      cname:
        - "ext:./geosite.dat:cn"
      logical_and: false
IrineSistiana commented 2 years ago

你电脑断网了而已。