Skip to content

Dns routing issue #1366

@IFedor-F

Description

@IFedor-F

Operating system

Linux

System version

Arch linux

Installation type

package manager

Version

1.1.2

Description

When selecting default: direct in the Routing -> Dns, the generated sing-box configuration places the local DNS server at the top of the dns.servers array. However, the Throne doesn't update routing rule at the end of dns.rules. All DNS queries are still forced through dns-remote

{
  // default: remote, fake ip: false, dns-routing: false
  "certificate": { "store": "system" },
  "dns": {
    "rules": [
      {
        "action": "predefined",
        "answer": "localhost. IN A 127.0.0.1",
        "domain": "localhost",
        "query_type": "A",
        "rcode": "NOERROR"
      },
      {
        "action": "predefined",
        "answer": "localhost. IN AAAA ::1",
        "domain": "localhost",
        "query_type": "AAAA",
        "rcode": "NOERROR"
      },
      { "action": "route", "server": "dns-remote", "strategy": "" }
    ],
    "servers": [
      {
        "detour": "proxy",
        "domain_resolver": "dns-local",
        "server": "1.1.1.1",
        "tag": "dns-remote",
        "type": "tls"
      },
      { "domain_resolver": "dns-local", "tag": "dns-direct", "type": "local" },
      { "tag": "dns-local", "type": "local" }
    ]
  },
  "endpoints": [],
  "experimental": {
    "cache_file": { "enabled": true, "store_fakeip": true, "store_rdrc": true }
  }
}
{
  // default: direct, fake ip: false, dns-routing: false
  "certificate": { "store": "system" },
  "dns": {
    "rules": [
      {
        "action": "predefined",
        "answer": "localhost. IN A 127.0.0.1",
        "domain": "localhost",
        "query_type": "A",
        "rcode": "NOERROR"
      },
      {
        "action": "predefined",
        "answer": "localhost. IN AAAA ::1",
        "domain": "localhost",
        "query_type": "AAAA",
        "rcode": "NOERROR"
      },
      { "action": "route", "server": "dns-remote", "strategy": "" }
    ],
    "servers": [
      { "domain_resolver": "dns-local", "tag": "dns-direct", "type": "local" },
      {
        "detour": "proxy",
        "domain_resolver": "dns-local",
        "server": "1.1.1.1",
        "tag": "dns-remote",
        "type": "tls"
      },
      { "tag": "dns-local", "type": "local" }
    ]
  },
  "endpoints": [],
  "experimental": {
    "cache_file": { "enabled": true, "store_fakeip": true, "store_rdrc": true }
  }
}

Rule { "action": "route", "server": "dns-remote", "strategy": "" } forces to use dns-remote.

Also I can't find any difference when using Enable DNS Routing. Sing-box configs are identical.
Config with dns routing on:

{
  // default: direct, fake ip: false, dns-routing: true
  "certificate": { "store": "system" },
  "dns": {
    "rules": [
      {
        "action": "predefined",
        "answer": "localhost. IN A 127.0.0.1",
        "domain": "localhost",
        "query_type": "A",
        "rcode": "NOERROR"
      },
      {
        "action": "predefined",
        "answer": "localhost. IN AAAA ::1",
        "domain": "localhost",
        "query_type": "AAAA",
        "rcode": "NOERROR"
      },
      { "action": "route", "server": "dns-remote", "strategy": "" }
    ],
    "servers": [
      { "domain_resolver": "dns-local", "tag": "dns-direct", "type": "local" },
      {
        "detour": "proxy",
        "domain_resolver": "dns-local",
        "server": "1.1.1.1",
        "tag": "dns-remote",
        "type": "tls"
      },
      { "tag": "dns-local", "type": "local" }
    ]
  },
  "endpoints": [],
  "experimental": {
    "cache_file": { "enabled": true, "store_fakeip": true, "store_rdrc": true }
  }
}

All sing-box configs (exported via share -> export sing-box config)
Also, with fake-ip : on dns routings works fine (checked in wireshark)

Reproduction

  1. Select Default DNS server in settings to direct/remote
  2. Turn off/on Enable DNS Routing in settings and compare sing-box configs

Logs

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions