MetaCubeX / mihomo

A simple Python Pydantic model for Honkai: Star Rail parsed data from the Mihomo API.
https://wiki.metacubex.one
MIT License
15.4k stars 2.55k forks source link

[Bug] 手机热点代理模式大量error: dns resolve failed #1373

Closed utopeadia closed 2 months ago

utopeadia commented 2 months ago

Verify steps

Operating System

No response

System Version

macos14.5

Mihomo Version

1.18.6

Configuration File

port: 7890
socks-port: 7891
redir-port: 7892
mixed-port: 7893
tproxy-port: 7894
allow-lan: false
bind-address: "*"
ipv6: true
external-controller: 127.0.0.1:9090
mode: rule
log-level: info
unified-delay: true
global-ua: clash.meta
geo-auto-update: true
geodata-mode: false
geo-update-interval: 12
geox-url:
  geoip: "https://testingcf.jsdelivr.net/gh/Loyalsoldier/v2ray-rules-dat@release/geoip.dat"
  geosite: "https://testingcf.jsdelivr.net/gh/Loyalsoldier/v2ray-rules-dat@release/geosite.dat"
  mmdb: "https://testingcf.jsdelivr.net/gh/Hackl0us/GeoIP2-CN@release/Country.mmdb"
sniffer:
  enable: true
  force-dns-mapping: true
  parse-pure-ip: true
  override-destination: true
  sniff:
    HTTP:
      ports: [80, 8080-8888]
      override-destination: true
    TLS:
      ports: [443, 8443]
    QUIC:
      ports: [443, 8443]
  force-domain:
    - +.v2ex.com
    - +.x.com
    - +.google.com
    - +.facebook.com
    - +.youtube.com
    - +.googlevideo.com
    - +.twitter.com
    - +.instagram.com
  skip-domain:
    - Mijia Cloud
    - Xiaomi Cloud
    - +.apple.com
    - +.icloud.com
dns:
  enabled: true
  ipv6: false
  fake-ip-filter:
    - '*.lan'
    - localhost.ptlogin2.qq.com
    - +.stun.*.*
    - +.stun.*.*.*
    - +.stun.*.*.*.*
    - +.stun.*.*.*.*.*
    - "*.n.n.srv.nintendo.net"
    - +.stun.playstation.net
    - xbox.*.*.microsoft.com
    - "*.*.xboxlive.com"
    - "*.msftncsi.com"
    - "*.msftconnecttest.com"
    - doh.pub
    - WORKGROUP
    - controlplane.tailscale.com
    - log.tailscale.io
    - 1.1.1.1
    - 119.29.29.29
    - 223.5.5.5
    - 8.8.8.8
  default-nameserver:
    - 119.29.29.29
    - 1.1.1.1
  nameserver:
    - system
    - dhcp://en0
    - https://doh.pub/dns-query
    - https://223.5.5.5/dns-query
  proxy-server-nameserver:
    - https://doh.pub/dns-query
    - https://223.5.5.5/dns-query
    - https://8.8.8.8/dns-query
  fallback:
    - https://8.8.8.8/dns-query
    - https://1.1.1.1/dns-query
  fallback-filter:
    geoip: false
    geoip-code: CN
    ipcidr:
      - 0.0.0.0/8
      - 10.0.0.0/8
      - 100.64.0.0/10
      - 127.0.0.0/8
      - 169.254.0.0/16
      - 172.16.0.0/12
      - 192.0.0.0/24
      - 192.0.2.0/24
      - 192.88.99.0/24
      - 198.18.0.0/15
      - 198.51.100.0/24
      - 203.0.113.0/24
      - 224.0.0.0/4
      - 240.0.0.0/4
      - 255.255.255.255/32
      - 46.82.174.69/32
      - 59.24.3.174/32
      - 8.7.198.46/32
      - 93.46.8.90/32
    domain:
      - "+.ai.com"
      - "+.algolia.net"
      - "+.anthropic.com"
      - "+.arkoselabs.com"
      - "+.auth0.com"
      - "+.azure.com"
      - "+.azureedge.net"
      - "+.azureedge.net"
      - "+.bing.com"
      - "+.bingapis.com"
      - "+.bugsnag.com"
      - "+.chatgpt.com"
      - "+.claude.ai"
      - "+.cloudflare.net"
      - "+.cloudflareinsights.com"
      - "+.cohere.ai"
      - "+.docker.com"
      - "+.docker.io"
      - "+.facebook.com"
      - "+.github.com"
      - "+.githubusercontent.com"
      - "+.google"
      - "+.google.com"
      - "+.google.dev"
      - "+.googleapis.cn"
      - "+.googlevideo.com"
      - "+.identrust.com"
      - "+.instagram.com"
      - "+.intercom.io"
      - "+.live.com"
      - "+.livekit.cloud"
      - "+.microsoft.com"
      - "+.microsoftapp.net"
      - "+.minecraft.net"
      - "+.msn.com"
      - "+.openai.com"
      - "+.poe.com"
      - "+.segment.com"
      - "+.segment.io"
      - "+.sentry.io"
      - "+.synn.cc"
      - "+.stripe.com"
      - "+.t.me"
      - "+.tailscale.com"
      - "+.tailscale.io"
      - "+.twitter.com"
      - "+.usefathom.com"
      - "+.v2ex.com"
      - "+.windows.net"
      - "+.wootric.com"
      - "+.x.com"
      - "+.xn--ngstr-lra8j.com"
      - "+.youtube.com"
tun:
  enable: true
  stack: mixed
  auto-route: true
  auto-detect-interface: true
  dns-hijack:
    - any:53
    - tcp://any:53
  device: utuncat0
  mtu: 1500
  strict-route: true
  include-package:
    - com.android.chrome
  exclude-package:
    - com.android.captiveportallogin

Description

连接手机热点,使用代理模式系统存在大量dns错误,反复刷新可以恢复,相同热点在tun模式下正常

Reproduction Steps

连接热点,开启系统代理

Logs

No response

utopeadia commented 2 months ago

使用客户端为clash verge rev

xishang0128 commented 2 months ago

no log no issue

utopeadia commented 2 months ago

no log no issue

这是一个很奇怪的问题,我查看了log日志,只查到了大量形如下面的日志内容,没找到更多信息,不过我猜测可能跟回环有关

2024-07-08 21:10:25 INFO [clash_verge::core::core] - [mihomo]: time="2024-07-08T21:10:25.588294+08:00" level=warning msg="[TCP] dial 🚁 全球直连 (match DomainSuffix/baidu.com) 127.0.0.1:53860(Google Chrome Helper) --> baidu.com:443 error: dns resolve failed: lookup baidu.com: i/o timeout"

2024-07-08 21:10:25 INFO [clash_verge::core::core] - [mihomo]: time="2024-07-08T21:10:25.697024+08:00" level=info msg="[TCP] 127.0.0.1:53878(Google Chrome Helper) --> baidu.com:443 match DomainSuffix(baidu.com) using 🚁 全球直连[DIRECT]"

2024-07-08 21:10:25 INFO [clash_verge::core::core] - [mihomo]: time="2024-07-08T21:10:25.964976+08:00" level=info msg="[TCP] 127.0.0.1:53882(Google Chrome Helper) --> www.baidu.com:443 match DomainSuffix(baidu.com) using 🚁 全球直连[DIRECT]"
xishang0128 commented 2 months ago

@utopeadia 使用level debug并且贴出完整日志

utopeadia commented 2 months ago

@utopeadia 使用level debug并且贴出完整日志 我截取了一部分出现问题的记录


2024-07-08 22:16:04 INFO - [mihomo]: time="2024-07-08T22:16:04.490608+08:00" level=debug msg="[DNS] resolve api.bilibili.com error: lookup api.bilibili.com: i/o timeout"

2024-07-08 22:16:04 INFO - [mihomo]: time="2024-07-08T22:16:04.508845+08:00" level=debug msg="[DNS] api.bilibili.com --> 110.40.30.33"

2024-07-08 22:16:04 INFO - [mihomo]: time="2024-07-08T22:16:04.508953+08:00" level=debug msg="[DNS] api.bilibili.com --> 119.84.174.67"

2024-07-08 22:16:04 INFO - [mihomo]: time="2024-07-08T22:16:04.508994+08:00" level=debug msg="[DNS] api.bilibili.com --> 110.40.30.34"

2024-07-08 22:16:04 INFO - [mihomo]: time="2024-07-08T22:16:04.509174+08:00" level=debug msg="[DNS] api.bilibili.com --> 110.40.30.32"

2024-07-08 22:16:04 INFO - [mihomo]: time="2024-07-08T22:16:04.508971+08:00" level=debug msg="[DNS] api.bilibili.com --> 119.84.174.66"

2024-07-08 22:16:04 INFO - [mihomo]: time="2024-07-08T22:16:04.510339+08:00" level=debug msg="[DNS] api.bilibili.com --> 119.84.174.66"

2024-07-08 22:16:04 INFO - [mihomo]: time="2024-07-08T22:16:04.510431+08:00" level=debug msg="[DNS] api.bilibili.com --> 119.84.174.66"

2024-07-08 22:16:04 INFO - [mihomo]: time="2024-07-08T22:16:04.510619+08:00" level=debug msg="[DNS] api.bilibili.com --> 110.40.30.32"

2024-07-08 22:16:04 INFO - [mihomo]: time="2024-07-08T22:16:04.55571+08:00" level=info msg="[TCP] 127.0.0.1:61758(Google Chrome Helper) --> api.bilibili.com:443 match DomainSuffix(bilibili.com) using 🚁 全球直连[DIRECT]"

2024-07-08 22:16:04 INFO - [mihomo]: time="2024-07-08T22:16:04.560631+08:00" level=debug msg="[DNS] resolve www.bilibili.com error: lookup www.bilibili.com: i/o timeout"

2024-07-08 22:16:04 INFO - [mihomo]: time="2024-07-08T22:16:04.588502+08:00" level=debug msg="[DNS] www.bilibili.com --> 110.40.30.34"

2024-07-08 22:16:04 INFO - [mihomo]: time="2024-07-08T22:16:04.615124+08:00" level=info msg="[TCP] 127.0.0.1:61759(Google Chrome Helper) --> www.bilibili.com:443 match DomainSuffix(bilibili.com) using 🚁 全球直连[DIRECT]"

2024-07-08 22:16:05 INFO - [mihomo]: time="2024-07-08T22:16:05.103303+08:00" level=debug msg="[Rule] use default rules"

2024-07-08 22:16:05 INFO - [mihomo]: time="2024-07-08T22:16:05.396624+08:00" level=debug msg="[Rule] use default rules"

2024-07-08 22:16:05 INFO - [mihomo]: time="2024-07-08T22:16:05.425193+08:00" level=debug msg="[Rule] use default rules"

2024-07-08 22:16:05 INFO - [mihomo]: time="2024-07-08T22:16:05.425229+08:00" level=debug msg="[Rule] use default rules"

2024-07-08 22:16:05 INFO - [mihomo]: time="2024-07-08T22:16:05.42704+08:00" level=debug msg="[Rule] use default rules"

2024-07-08 22:16:05 INFO - [mihomo]: time="2024-07-08T22:16:05.569763+08:00" level=debug msg="[DNS] xy180x97x231x2xy.mcdn.bilivideo.cn --> 180.97.231.2"

2024-07-08 22:16:05 INFO - [mihomo]: time="2024-07-08T22:16:05.569859+08:00" level=debug msg="[DNS] xy180x97x231x2xy.mcdn.bilivideo.cn --> 180.97.231.2"

2024-07-08 22:16:05 INFO - [mihomo]: time="2024-07-08T22:16:05.825203+08:00" level=debug msg="[Rule] use default rules"

2024-07-08 22:16:05 INFO - [mihomo]: time="2024-07-08T22:16:05.844871+08:00" level=debug msg="[Rule] use default rules"

ArchGuyWu commented 2 months ago

@utopeadia 配置文件里DNS部分没设置增强模式却有fakeip相关内容,还有一些重复项,mihomo能启动已经很神奇了🤣

utopeadia commented 2 months ago

@utopeadia 配置文件里DNS部分没设置增强模式却有fakeip相关内容,还有一些重复项,mihomo能启动已经很神奇了🤣

这个配置加来加去已经快被我堆成屎山了,现在能用也没敢删改

xishang0128 commented 2 months ago

@utopeadia 无法复现,请确保这不是由错误的配置引发的问题

utopeadia commented 2 months ago

@utopeadia 无法复现,请确保这不是由错误的配置引发的问题

明后天我从最简配置开始重新试一下,先关闭issus