SagerNet / sing-box

The universal proxy platform
https://sing-box.sagernet.org/
Other
20.22k stars 2.41k forks source link

DNS: exchange failed for local DNS #2313

Closed devopg closed 2 hours ago

devopg commented 2 hours ago

Operating system

Linux

System version

ubuntu 24.04

Installation type

Original sing-box Command Line

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

No response

Version

1.10.2

Description

Hello, the rules are very simple: for ".ru" domains, use the local DNS; everything else should go to proxy->Cloudflare. However, when making a request to myip.ru, an error occurs. If I disable sing-box and make the request, it works with the system's local DNS. What could be the problem? ERROR[0652] [1437494369 0ms] dns: exchange failed for myip.ru. IN HTTPS: no raw query support by current transport

Or maybe I don't understand how this works, and 'local sing-box' is an additional layer between the standard system DNS and sing-box? Do I need to set the address to '127.0.0.53:53' instead of 'local'?

like this?

 {
        "address": "127.0.0.53:53",
        "detour": "direct",
        "tag": "dns-direct"
}

(And what is "local"? Is that really correct? Shouldn't the address be "localhost"?)

 {
        "address": "localhost",  ?????
        "detour": "direct",
        "tag": "dns-direct"
}

Without sing-box local dns work fine as local dns: image image

 "dns": {
    "servers": [
      {
        "address": "https://1.1.1.1/dns-query",
        "address_resolver": "dns-direct",
        "detour": "proxy",
        "tag": "dns-remote"
      },
      {
        "address": "local",
        "detour": "direct",
        "tag": "dns-direct"
      }
    ],
    "rules": [
      {
        "outbound": "any",
        "server": "direct"
      },
      {
        "domain_suffix": [
          "ru"
        ],
        "server": "dns-direct"
      }
    ]
  },

Reproduction

Enter my DNS configuration and make a request to myip.ru.

Logs

No response

Supporter

Integrity requirements

devopg commented 2 hours ago

@dyhkwong ??? I found this issue https://github.com/SagerNet/sing-box/issues/1158, and it says that types other than A and AAAA are not supported, BUT my record type is A.

And what about my question regarding address for understanding: address: local | localhost | 127.0.0.53:53 ?

dyhkwong commented 54 minutes ago

dns: exchange failed for myip.ru. IN HTTPS: no raw query support by current transport It is HTTPS, neither A nor AAAA. local in the command line version means using Go resolver.