Skip to content

[Feature Request] inboundTag matcher in the Built-in DNS Server #4987

@gfw-killer

Description

@gfw-killer

Hello
I have a private Xray server, it has multiple outbounds like warp and tor and UK and US and more, and i have a different Inbound for each one
I want Xray to use Mullvad DoH DNS for all of them(and another public dns server as failover fallback), but not to solve the DNS Requests directly, for example if Inbound is reality-tor and outbound is tor-outbound, then DNS server must use a specific server and use tor-outbound to solve the DNS and have a separated cache for it (a different cache for tor and another for warp, to prevent dns/ip leak)

Could you please add inboundTag matcher to Xray's DNS Server?

I mean something like this in theory (not included a DoH or DNS Hijacker in the sample)

{
  "dns": {
    "servers": [
      {
        "tag": "cf-tor-dns",
        "address": "1.1.1.1",
        "inboundTag": "reality-tor"
      },
      {
        "tag": "google-tor-dns",
        "address": "8.8.8.8",
        "inboundTag": "reality-tor"
      },
      {
        "tag": "cf-warp-dns",
        "address": "1.1.1.1",
        "inboundTag": "reality-warp"
      },
      {
        "tag": "google-warp-dns",
        "address": "8.8.8.8",
        "inboundTag": "reality-warp"
      }
    ],
    "disableFallbackIfMatch": true
  },
  "routing": {
    "domainStrategy": "AsIs",
    "rules": [
      {
        "inboundTag": [
          "cf-tor-dns",
          "google-tor-dns"
        ],
        "outboundTag": "tor"
      },
      {
        "inboundTag": [
          "cf-warp-dns",
          "google-warp-dns"
        ],
        "outboundTag": "warp"
      },
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions