mosdns-cn icon indicating copy to clipboard operation
mosdns-cn copied to clipboard

failed to init entry, missing local upstream

Open marcoreus111 opened this issue 2 years ago • 2 comments

开发者你好,我运行时遇到了如下问题,不知道该如何解决,能帮忙看下吗? 万分感谢!!!

运行时错误代码如下: 2022-08-30T13:21:41.309+0800 info mosdns-cn/main.go:246 mosdns-cn ver: 1.4.0 2022-08-30T13:21:41.310+0800 info mosdns-cn/main.go:247 arch: amd64, os: linux, go: go1.18.2 2022-08-30T13:21:41.311+0800 fatal mosdns-cn/main.go:251 failed to init entry, missing local upstream

my-config.yaml文件如下: server_addr: ":53" cache_size: 5120 lazy_cache_ttl: 86400 lazy_cache_reply_ttl: 30 redis_cache: "" min_ttl: 0 max_ttl: 0 hosts: [] blacklist_domain:

  • "geosite.dat:category-ads-all" insecure: false ca: [] debug: false log_file: "" upstream: local_upstream:
  • 119.29.29.29
  • 202.99.192.66
  • 223.5.5.5
  • tls://223.5.5.5:853?enable_pipeline=true local_ip:
  • "geoip.dat:cn" local_domain:
  • "geosite.dat:cn" local_latency: 60 remote_upstream:
  • udpme://8.8.8.8
  • udpme://1.1.1.1
  • 54.65.228.76
  • tls://208.67.220.220:853?enable_pipeline=true&socks5=127.0.0.1:20170
  • tls://1.1.1.1:853?enable_pipeline=true&socks5=127.0.0.1:20170
  • https://8.8.8.8/dns-query?enable_pipeline=true&socks5=127.0.0.1:20170
  • https://dns.cloudflare.com/dns-query?enable_pipeline=true&socks5=127.0.0.1:20170 remote_domain:
  • "geosite.dat:geolocation-!cn" working_dir: "/etc/mosdns-cn/" cd2exe: false

marcoreus111 avatar Aug 30 '22 05:08 marcoreus111

你解决了没,我好像跟你一样?

StarBalll avatar Dec 12 '22 03:12 StarBalll

你解决了没,我好像跟你一样?

可能是配置文件的原因,换一个配置文件重新试一下吧,应该可以解决,这是我现在的配置文件,你参考一下。 log: level: warn file: ""

data_providers:

  • tag: geosite file: ./geosite.dat auto_reload: true
  • tag: geoip file: ./geoip.dat auto_reload: true
  • tag: hosts file: ./hosts.txt auto_reload: true

plugins:

缓存

  • tag: cache type: cache args: size: 10240 lazy_cache_ttl: 86400

  • tag: forward_local type: fast_forward args: upstream: - addr: tls://120.53.53.53:853 enable_pipeline: true

    - addr: tls://223.6.6.6:853
      trusted: true
    
    - addr: 119.29.29.29
      trusted: true
    
    - addr: 223.5.5.5
      trusted: true
    
  • tag: forward_remote type: fast_forward args: upstream: - addr: tls://8.8.4.4:853 enable_pipeline: true - addr: https://8.8.8.8/dns-query - addr: udpme://8.8.8.8 trusted: true

    - addr: https://dns.cloudflare.com/dns-query
      dial_addr: 1.0.0.1
      enable_pipeline: true
    
    - addr: tls://1dot1dot1dot1.cloudflare-dns.com
      dial_addr: 1.0.0.1
      enable_pipeline: true
    
    - addr: udpme://1.1.1.1
      trusted: true
    
  • tag: query_is_local_domain type: query_matcher args: domain: - 'provider:geosite:apple-cn' - 'provider:geosite:google-cn' - 'provider:geosite:category-games@cn' - 'provider:geosite:cn' - 'provider:geosite:private'

匹配非本地域名的插件

  • tag: query_is_non_local_domain type: query_matcher args: domain: - 'provider:geosite:geolocation-!cn'

匹配广告域名的插件

  • tag: query_is_ad_domain type: query_matcher args: domain: - 'provider:geosite:category-ads-all'

匹配本地 IP 的插件

  • tag: response_has_local_ip type: response_matcher args: ip: - 'provider:geoip:cn' - 'provider:geoip:private'

  • tag: main_sequence type: sequence args: exec: # 缓存 - cache

    # 屏蔽广告域名
    - if: query_is_ad_domain
      exec:
        - _new_nxdomain_response
        - _return
    
    # 已知的本地域名用本地服务器解析
    - if: query_is_local_domain
      exec:
        - forward_local
        - _return
    
    # 已知的非本地域名用远程服务器解析
    - if: query_is_non_local_domain
      exec:
        - forward_remote
        - _return
    
      # 剩下的未知域名用 IP 分流。
      # 这里借助了 `fallback` 工作机制。分流原理请参考 `fallback`
      # 的工作流程。
      # primary 从本地服务器获取应答,丢弃非本地 IP 的结果。
    - primary:
        - forward_local
        - if: "(! response_has_local_ip) && [_response_valid_answer]"
          exec:
            - _drop_response
      # secondary 从远程服务器获取应答。
      secondary:
        - _prefer_ipv4
        - forward_remote
      # 这里建议设置成 local 服务器正常延时的 2~5 倍。
      # 这个延时保证了 local 延时偶尔变高时,其结果不会被 remote 抢答。
      # 如果 local 超过这个延时还没响应,可以假设 local 出现了问题。
      # 这时用就采用 remote 的应答。单位: 毫秒。
      fast_fallback: 140
    

servers:

  • exec: main_sequence listeners:
    • protocol: udp addr: 0.0.0.0:53
    • protocol: tcp addr: 0.0.0.0:53

marcoreus111 avatar Dec 15 '22 04:12 marcoreus111