sing-box-1.13.21-r1 failed to map dns

Aperta
#4,700 3 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
38/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
go
Ambito
networking

Direzione di ricerca

Start by tracing DNS reverse mapping and route selection from the provided configurations, then compare the DNS log entries with the subsequent tproxy connection to identify where the mapping is lost. Reproduce the intermittent behavior on OpenWrt 25.12.6 with sing-box 1.13.21-r1; done means DNS-resolved traffic for rutracker.org consistently follows the tor rule instead of the direct final route. The payload names no source files or tests.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Operating system

Others

System version

OpenWrt 25.12.6,

Installation type

Others

If you are using a graphical client, please provide the version of the client.

No response

Version

Description

sing-box failed to map dns properly and send traffic direct instead of tor

{
  "log": {
    "level": "info",
    "timestamp": true
  },
  "inbounds": [
    {
      "type": "tproxy",
      "tag": "tproxy4",
      "listen": "127.0.0.1",
      "listen_port": 12345
    },
    {
      "type": "tproxy",
      "tag": "tproxy6",
      "listen": "::1",
      "listen_port": 12345
    }
  ],
  "route": {
    "rules": [
      {
        "inbound": [ "tproxy4", "tproxy6" ],
        "timeout": "300ms",
        "action": "sniff"
      }
    ],
    "final": "direct"
  },
  "outbounds": [
    {
      "type": "direct",
      "tag": "direct"
    },
    {
      "type": "block",
      "tag": "block"
    }
  ]
}

{
  "inbounds": [
    {
      "type": "direct",
      "tag": "dns4",
      "listen": "10.10.5.5",
      "listen_port": 53
    },
    {
      "type": "direct",
      "tag": "dns6",
      "listen": "fd00:10:10:5::5",
      "listen_port": 53
    }
  ],
  "dns": {
    "servers": [
      {
        "tag": "dnsmasq",
        "type": "udp",
        "server": "127.0.0.1",
        "server_port": 53
      }
    ],
    "reverse_mapping": true,
    "final": "dnsmasq"
  },
  "route": {
    "rules": [
      {
        "inbound": [
          "dns4",
          "dns6"
        ],
        "action": "hijack-dns"
      }
    ]
  }
}

{
  "route": {
    "rules": [
      {
        "protocol": ["quic"],
        "domain_suffix": [
            "rutracker.org",
            "static.rutracker.cc",
        ],
        "outbound": "block"
      },
      {
        "domain_suffix": [
            "rutracker.org",
            "static.rutracker.cc",
        ],
        "outbound": "tor"
      },
    ]
  }
}
Reproduction

sometimes it works sometimes it dosn't. most of times it failed.

Logs
+0000 2026-11-07 18:15:27 INFO [387412243 0ms] inbound/direct[dns4]: inbound packet connection from 10.10.5.80:47603
+0000 2026-11-07 18:15:27 INFO [387412243 0ms] inbound/direct[dns4]: inbound packet connection to 10.10.5.5:53
+0000 2026-11-07 18:15:27 INFO [3483881824 0ms] inbound/direct[dns6]: inbound packet connection from [fd00:10:10:5::4b5]:47603
+0000 2026-11-07 18:15:27 INFO [3483881824 0ms] inbound/direct[dns6]: inbound packet connection to [fd00:10:10:5::5]:53
+0000 2026-11-07 18:15:27 INFO [3483881824 35ms] dns: exchanged HTTPS rutracker.org. 46 IN HTTPS 1 . alpn="h3,h2" ipv4hint="104.21.32.39,172.67.182.196" ech="AEX+DQBBZgAgACAN/u7MIGuhSwOL8cDvkDFHX4KMsdzd1KRsNQIs+fEgEQAEAAEAAQASY2xvdWRmbGFyZS1lY2guY29tAAA=" ipv6hint="2606:4700:3035::6815:2027,2606:4700:3037::ac43:b6c4"
+0000 2026-11-07 18:15:27 INFO [387412243 36ms] dns: cached HTTPS rutracker.org. 45 IN HTTPS 1 . alpn="h3,h2" ipv4hint="104.21.32.39,172.67.182.196" ech="AEX+DQBBZgAgACAN/u7MIGuhSwOL8cDvkDFHX4KMsdzd1KRsNQIs+fEgEQAEAAEAAQASY2xvdWRmbGFyZS1lY2guY29tAAA=" ipv6hint="2606:4700:3035::6815:2027,2606:4700:3037::ac43:b6c4"
+0000 2026-11-07 18:15:28 INFO [1060455280 0ms] inbound/tproxy[tproxy6]: inbound connection from [2a00:62c0:1b3e:9700::4b5]:44882
+0000 2026-11-07 18:15:28 INFO [1060455280 0ms] inbound/tproxy[tproxy6]: inbound connection to [2606:4700:3037::ac43:b6c4]:443
+0000 2026-11-07 18:15:28 INFO [1060455280 8ms] outbound/direct[direct]: outbound connection to [2606:4700:3037::ac43:b6c4]:443
Supporter
Integrity requirements
  • I confirm that I have read the documentation, understand the meaning of all the configuration items I wrote, and did not pile up seemingly useful options or default values.
  • I confirm that I have provided the server and client configuration files and process that can be reproduced locally, instead of a complicated client configuration file that has been stripped of sensitive data.
  • I confirm that I have provided the simplest configuration that can be used to reproduce the error I reported, instead of depending on remote servers, TUN, graphical interface clients, or other closed-source software.
  • I confirm that I have provided the complete configuration files and logs, rather than just providing parts I think are useful out of confidence in my own intelligence.
Lingua principale
Go
Stelle
40.4k
Fork
5k
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

  • Include un Dockerfile o un file Docker Compose
  • Nessun modello di pull request
  • Nessuna guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di SagerNet/sing-box

Tutte le issue di SagerNet/sing-box

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.