chika0801 / sing-box-examples

sing-box 配置示例
https://github.com/SagerNet/sing-box
1.8k stars 299 forks source link

Converting xray DNS to sing-box DNS #35

Closed ghost closed 1 year ago

ghost commented 1 year ago

Hello,

I use this config in xray to manage DNS.

{
  "dns": {
    "tag": "dns",
    "hosts": {
      "dns.cloudflare.com": [
        "104.16.132.229",
        "104.16.133.229",
        "1.1.1.1",
        "1.0.0.1"
      ],
      "domain:youtube.com": [
        "google.com"
      ]
    },
    "servers": [
      "https://dns.cloudflare.com/dns-query",
      "https://cloudflare-dns.com/dns-query"
    ]
  }
}

The important part is I resolve some of domains myself by providing IPs or mapping 2 domains to each other which have same IPs.

I wonder how can I achieve this in sing-box?

chika0801 commented 1 year ago

http://sing-box.sagernet.org/zh/configuration/dns/rule/

I read the link and I don't think the features you want are provided in the sing-box. I suggest you go to sing-box's gitbub and post an iss for help.

chika0801 commented 1 year ago

"hosts": { "dns.cloudflare.com": [ "104.16.132.229", "104.16.133.229", "1.1.1.1", "1.0.0.1" ],

You're asking about this part of the xray configuration and how it's implemented in sing-box, right?

ghost commented 1 year ago

In this example, dns.cloudflare.com resolves to 104.16.132.229, 104.16.133.229, 1.1.1.1 and 1.0.0.1 only. Or youtube.com is resolved with google.com IPs.

How is this possible in sing-box?

chika0801 commented 1 year ago

In this example, dns.cloudflare.com resolves to 104.16.132.229, 104.16.133.229, 1.1.1.1 and 1.0.0.1 only. Or youtube.com is resolved with google.com IPs.

How is this possible in sing-box?

From what I know, this cannot be accomplished in sing-box.

ghost commented 1 year ago

Thank you for your response

chika0801 commented 1 year ago

https://sing-box.sagernet.org/support/

If you need to go to Sing-box's community for help, you can contact them here.

ghost commented 1 year ago

I will contact them for sure. Thank you