MetaCubeX / mihomo

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

[Bug] api dns/query all DNS requests failed, first error: interface not found #793

Closed 0jinxing closed 9 months ago

0jinxing commented 9 months ago

Verify steps

Clash version

Clash Meta alpha-1292830 darwin amd64 with go1.21.2 Wed Oct 11 14:55:00 UTC 2023 Use tags: with_gvisor

What OS are you seeing the problem on?

macOS

Clash config

pr:
  &pr { type: select, proxies: [SELF-HOSTED, SUBSCRIBED, AUTO, DIRECT, REJECT] }

p:
  &p {
    type: http,
    interval: 3600,
    health-check:
      {
        enable: true,
        url: https://www.gstatic.com/generate_204,
        interval: 300,
      },
  }

use: &use
  type: select
  use:
    - "provider@ones.gq"

proxy-providers:
  "provider@ones.gq":
    <<: *p
    url: "http://provider@ones.gq"

mode: rule
log-level: info
allow-lan: false
mixed-port: 7890
unified-delay: false
tcp-concurrent: true
external-controller: 127.0.0.1:9090

geodata-mode: true
geox-url:
  geoip: "https://fastly.jsdelivr.net/gh/MetaCubeX/meta-rules-dat@release/geoip.dat"
  geosite: "https://fastly.jsdelivr.net/gh/MetaCubeX/meta-rules-dat@release/geosite.dat"
  mmdb: "https://fastly.jsdelivr.net/gh/MetaCubeX/meta-rules-dat@release/country.mmdb"

find-process-mode: strict
global-client-fingerprint: chrome

profile:
  store-selected: true
  store-fake-ip: true

sniffer:
  enable: true
  sniff:
    TLS:
      ports: [443, 8443]
    HTTP:
      ports: [80, 8080-8880]
      override-destination: true
tun:
  enable: true
  stack: system
  dns-hijack:
    - 'any:53'
  auto-route: true
  auto-detect-interface: true

dns:
  enable: true
  listen: :1053
  ipv6: true
  enhanced-mode: fake-ip
  fake-ip-range: 28.0.0.1/8
  fake-ip-filter:
    - "*"
    - "+.lan"
    - "+.local"
  default-nameserver:
    - 223.5.5.5
  nameserver:
    - "tls://8.8.4.4#dns"
    - "tls://1.0.0.1#dns"
  proxy-server-nameserver:
    - https://doh.pub/dns-query
  nameserver-policy:
    "geosite:cn,private":
      - https://doh.pub/dns-query
      - https://dns.alidns.com/dns-query

proxies:
  - {
      "name": "SELF-HOSTED",
      "type": "vless",
      "server": "server",
      "port": port,
      "udp": true,
      "uuid": "uuid",
      "tls": true,
      "servername": "swdist.apple.com",
      "flow": "xtls-rprx-vision",
      "network": "tcp",
      "reality-opts":
        {
          "public-key": "public-key",
          "short-id": "short-id",
        },
      "client-fingerprint": "chrome",
    }

proxy-groups:
  - { name: 🇨🇳国内, type: select, proxies: [DIRECT] }
  - { name: 🏳️‍🌈外网, <<: *pr }
  - { name: 🏴‍☠️流媒体, <<: *pr }
  - { name: SUBSCRIBED, <<: *use }
  - { name: AUTO, <<: *use, tolerance: 2, type: url-test }

rules:
  - GEOSITE,CN,🇨🇳国内
  - GEOIP,CN,🇨🇳国内
  - GEOSITE,!CN,🏳️‍🌈外网
  - GEOIP,!CN,🏳️‍🌈外网
  - GEOSITE,netflix,🏴‍☠️流媒体
  - GEOSITE,youtube,🏴‍☠️流媒体
  - GEOSITE,disney,🏴‍☠️流媒体

Clash log

all DNS requests failed, first error: interface not found

Description

截屏2023-10-14 21 51 41
0jinxing commented 9 months ago

tun mode 使用正常,但是还是无法 执行 dns 查询

0jinxing commented 9 months ago

13-inch, 2020, Four Thunderbolt 3 ports macOS 13.6 (22G120)

0jinxing commented 9 months ago
curl 'http://127.0.0.1:9090/dns/query?name=google.com&type=A' \
  -H 'Accept-Language: zh-CN,zh;q=0.9' \
  -H 'Connection: keep-alive' \
  -H 'Origin: https://d.metacubex.one' \
  -H 'Sec-Fetch-Dest: empty' \
  -H 'Sec-Fetch-Mode: cors' \
  -H 'Sec-Fetch-Site: cross-site' \
  -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Safari/537.36' \
  -H 'accept: application/json' \
  -H 'sec-ch-ua: "Chromium";v="118", "Google Chrome";v="118", "Not=A?Brand";v="99"' \
  -H 'sec-ch-ua-mobile: ?0' \
  -H 'sec-ch-ua-platform: "macOS"' \
  --compressed

Response

{"message":"all DNS requests failed, first error: interface not found"}
xishang0128 commented 9 months ago

按照dns设置,非cn域名查询nameserver服务器,但是你nameserver配置了dns代理,但是你并没有"dns"这个代理/代理组,这将导致nameserver无法连接