From 9516b07a3ccd70848ffad7f708c591012c4823c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=A1=E3=81=8B?= <88967758+chika0801@users.noreply.github.com> Date: Tue, 26 Dec 2023 12:23:18 +0800 Subject: [PATCH] Update queryStrategy parameter explanation [ENG] (#439) --- docs/en/config/dns.md | 65 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) diff --git a/docs/en/config/dns.md b/docs/en/config/dns.md index 47724f2..828bc34 100644 --- a/docs/en/config/dns.md +++ b/docs/en/config/dns.md @@ -59,6 +59,22 @@ If the domain name to be queried: "skipFallback": false, "clientIP": "1.2.3.4" }, + { + "address": "https://1.1.1.1/dns-query", + "domains": [ + "geosite:netflix" + ], + "skipFallback": true, + "queryStrategy": "UseIPv4" + }, + { + "address": "https://1.1.1.1/dns-query", + "domains": [ + "geosite:openai" + ], + "skipFallback": true, + "queryStrategy": "UseIPv6" + }, "localhost" ], "clientIp": "1.2.3.4", @@ -135,6 +151,55 @@ You can specify `clientIp` for all DNS servers in [DnsObject](#dnsobject), or sp `UseIPv4` only queries A records; `UseIPv6` only queries AAAA records. The default value is `UseIP`, which queries both A and AAAA records. +Xray-core v1.8.6 New feature: `queryStrategy` can be set separately for each `DNS` server. + +```jsonc + "dns": { + "servers": [ + "https://1.1.1.1/dns-query", + { + "address": "https://1.1.1.1/dns-query", + "domains": [ + "geosite:netflix" + ], + "skipFallback": true, + "queryStrategy": "UseIPv4" // geosite:netflix's domain name uses "UseIPv4" + }, + { + "address": "https://1.1.1.1/dns-query", + "domains": [ + "geosite:openai" + ], + "skipFallback": true, + "queryStrategy": "UseIPv6" // The domain name geosite:openai uses "UseIPv6". + } + ], + "queryStrategy": "UseIP" // Global use of "UseIP" + } +``` + +**NOTEļ¼š**
+When the `"queryStrategy"` value in the child item conflicts with the global `"queryStrategy"` value, the query for the child item will respond null. + +```jsonc + "dns": { + "servers": [ + "https://1.1.1.1/dns-query", + { + "address": "https://8.8.8.8/dns-query", + "domains": [ + "geosite:netflix" + ], + "skipFallback": true, + "queryStrategy": "UseIPv6" // "UseIPv6" conflicts with "UseIPv4". + } + ], + "queryStrategy": "UseIPv4" + } +``` + +Subterm geosite:netflix query gets null response due to conflicting `"queryStrategy"` values. geosite:netflix domain is queried by global DNS `https://1.1.1.1/dns-query` and gets A record. + > `disableCache`: true | false `true` disables DNS caching, default is `false` which means caching is not disabled.