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

failed to init entry, missing local upstream #37

Open
marcoreus111 opened this issue Aug 30, 2022 · 2 comments
Open

failed to init entry, missing local upstream #37

marcoreus111 opened this issue Aug 30, 2022 · 2 comments

Comments

@marcoreus111
Copy link

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

运行时错误代码如下:
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:

@StarBalll
Copy link

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

@marcoreus111
Copy link
Author

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

可能是配置文件的原因,换一个配置文件重新试一下吧,应该可以解决,这是我现在的配置文件,你参考一下。
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

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