Skip to content

XDNS finalmask: Refactor and new parameters - #6718

Merged
RPRX merged 94 commits into
XTLS:mainfrom
LjhAUMEM:xdns
Sep 29, 2026
Merged

RPRX merged 94 commits into
XTLS:mainfrom
LjhAUMEM:xdns

Conversation

@LjhAUMEM

@LjhAUMEM LjhAUMEM commented Sep 3, 2026 •

Copy link
Copy Markdown
Contributor

closes #6692

{
  "log": { "loglevel": "debug" },
  "inbounds": [
    {
      "listen": "127.0.0.1",
      "port": 53,
      "protocol": "vless",
      "settings": {
        "clients": [
          {
            "id": "5783a3e7-e373-51cd-8642-c83782b807c5"
          }
        ],
        "decryption": "none"
      },
      "streamSettings": {
        "network": "mkcp",
        "kcpSettings": {
          "tti": 200,
          "mtu": 932
        },
        "finalmask": {
          "udp": [
            {
              "type": "xdns",
              "settings": {
                "domains": [
                  {
                    "name": "t.example.com",
                    "types": [16],
                    "edns0": 1232
                  }
                ]
              }
            }
          ]
        }
      }
    }
  ],
  "outbounds": [
    {
      "protocol": "freedom"
    }
  ]
}
{
  "log": { "loglevel": "debug" },
  "inbounds": [
    {
      "listen": "127.0.0.1",
      "port": 1080,
      "protocol": "socks",
      "settings": {
        "auth": "noauth",
        "udp": true
      }
    }
  ],
  "outbounds": [
    {
      "protocol": "vless",
      "settings": {
        "address": "127.0.0.1",
        "port": 53,
        "id": "5783a3e7-e373-51cd-8642-c83782b807c5",
        "encryption": "none"
      },
      "streamSettings": {
        "network": "kcp",
        "kcpSettings": {
          "tti": 200
        },
        "finalmask": {
          "udp": [
            {
              "type": "xdns",
              "settings": {
                "domains": [
                  {
                    "name": "t.example.com",
                    "lenLimit": 255,
                    "labelLimit": 63,
                    "types": [16],
                    "edns0": 1232
                  }
                ],
                "resolvers": [
                  {
                    "type": "udp",
                    "settings": {
                      "addr": "127.0.0.1:53"
                    }
                  }
                ]
              }
            }
          ]
        }
      }
    }
  ]
}

@Fangliding
Fangliding marked this pull request as draft September 3, 2026 14:53
@LjhAUMEM LjhAUMEM changed the title xdns xdns2.0 Sep 4, 2026
@LjhAUMEM

LjhAUMEM commented Sep 5, 2026

Copy link
Copy Markdown
Contributor Author

2.0 预计改动

  1. 支持配置 域名label最大长度 域名最大长度
  2. 支持配置 initPollDelay maxPollDelay pollDelayMultiplier (仅客户端) maxResponseDelay (仅服务端)
  3. 支持配置 ends0 (仅长度字段,对于服务端意义为 mtu,对于单个查询将先预测 cap,再决定是否 frag,上层无需再限制 mtu)
  4. 删除 sendLoop
  5. 添加 SocketConfig 配置 (用于改回多 socket 模式),同时将只支持作为最后一层配置

@LjhAUMEM
LjhAUMEM force-pushed the xdns branch 2 times, most recently from df0c097 to b7a37fe Compare September 18, 2026 02:43
@LjhAUMEM

Copy link
Copy Markdown
Contributor Author

原来 make chan 的容量不是 1,是 0,我说为什么卡住了,学到了

@LjhAUMEM
LjhAUMEM marked this pull request as ready for review September 19, 2026 06:51
@LjhAUMEM

Copy link
Copy Markdown
Contributor Author

终于进入测试阶段,虽然不要求上层配置 mtu 了但也不是无脑可用,需要搭配 extraPoll minAvailable,得想想怎么解释这两

@LjhAUMEM

Copy link
Copy Markdown
Contributor Author

server

Details

{
  "log": { "loglevel": "debug" },
  "inbounds": [
    {
      "listen": "127.0.0.1",
      "port": 53,
      "protocol": "vless",
      "settings": {
        "clients": [
          {
            "id": "5783a3e7-e373-51cd-8642-c83782b807c5"
          }
        ],
        "decryption": "none"
      },
      "streamSettings": {
        "network": "mkcp",
        "kcpSettings": {
          "tti": 200
        },
        "finalmask": {
          "udp": [
            {
              "type": "xdns",
              "settings": {
                "domains": [
                  {
                    "name": "t.example.com",
                    "types": [1, 5, 16, 28],
                    "edns0": 0
                  }
                ],
                "minAvailable": 3
              }
            }
          ]
        }
      }
    }
  ],
  "outbounds": [
    {
      "protocol": "freedom"
    }
  ]
}

client

Details

{
  "log": { "loglevel": "debug" },
  "inbounds": [
    {
      "listen": "127.0.0.1",
      "port": 1080,
      "protocol": "socks",
      "settings": {
        "auth": "noauth",
        "udp": true
      }
    }
  ],
  "outbounds": [
    {
      "protocol": "vless",
      "settings": {
        "address": "127.0.0.1",
        "port": 53,
        "id": "5783a3e7-e373-51cd-8642-c83782b807c5",
        "encryption": "none"
      },
      "streamSettings": {
        "network": "kcp",
        "kcpSettings": {
          "tti": 200
        },
        "finalmask": {
          "udp": [
            {
              "type": "xdns",
              "settings": {
                "domains": [
                  {
                    "name": "t.example.com",
                    "lenLimit": 200,
                    "labelLimit": 1,
                    "types": [
                      1,
                      5,
                      16,
                      28
                    ],
                    "edns0": 1232
                  }
                ],
                "resolvers": [
                  {
                    "type": "udp",
                    "settings": {
                      "addr": "127.0.0.1:53"
                    }
                  }
                ],
                "extraPoll": 1
              }
            }
          ]
        }
      }
    }
  ]
}

@RPRX

RPRX commented Sep 20, 2026

Copy link
Copy Markdown
Member

@LjhAUMEM rebase,ready 时说一声

@LjhAUMEM

Copy link
Copy Markdown
Contributor Author

@LjhAUMEM rebase,ready 时说一声

在测 quic,今天或明天

quic transport 单独拿出来用依赖 SetReadDeadline close 啊,如果没有实现就会无限阻塞,需要把 pkt close 和 tr close 顺序对换下

https://github.com/quic-go/quic-go/blob/3c2c36b259ce06fd8cc14458cc8b0c8f408462fd/transport.go#L467-L477

@LjhAUMEM
LjhAUMEM marked this pull request as ready for review September 24, 2026 15:23
@LjhAUMEM

Copy link
Copy Markdown
Contributor Author

没有给 quic 适配上还是不太满意,但高强度三周已经燃尽了,新方法也懒得测了,先用回老方法吧,理论上这种简易分片可以单独搞一个层出来

服务端支持多类型查询时要设置类型中最小的 mtu

@RPRX

RPRX commented Sep 29, 2026

Copy link
Copy Markdown
Member

只看了下配置,原先全部编码进一行的语法彻底改成结构化的 JSON 配置了,并且加了些新参数,以后加别的新参数也方便些

我想了下,这里既然不是 TLS DoH 那种直接放进分享链接的,而是分享整个 JSON,改成这么设计也行吧,趁着 XDNS 现在不是刚需,break 就 break 了吧,文档写明白就行

@RPRX RPRX changed the title xdns2.0 XDNS finalmask: Refactor and new parameters Sep 29, 2026
@RPRX
RPRX merged commit fc8f8a4 into XTLS:main Sep 29, 2026
40 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

XDNS: Additional A queries by the recursive DNS resolver alter the TXT client’s method and break the transport

2 participants