v5配置中如何将ip加入路由规则,以及如何使匹配geosite的域名优先使用指定DNS查询ip? #3131
Answered
by
LuciusKyle
minusmulticoloredper
asked this question in
Q&A
-
|
以下是配置文件,怎么配置才行? {
"log": {
"access": {
"type": "Console",
"level": "Info"
},
"error": {
"type": "Console",
"level": "Error"
}
},
"inbounds": [
{
"tag": "socks",
"listen": "127.0.0.1",
"port": 10808,
"protocol": "socks",
"sniffing": {
"enabled": false
},
"settings": {
"udpEnabled": true
}
},
{
"tag": "http",
"listen": "127.0.0.1",
"port": 10809,
"protocol": "http",
"sniffing": {
"enabled": false
},
"settings": {}
}
],
"outbounds": [
{
"tag": "proxy",
"protocol": "shadowsocks",
"settings": {
"address": "xxx.xxx.xxx",
"method": "chacha20-ietf-poly1305",
"password": "xxx",
"port": 10000
},
"streamSettings": {
"transport": "tcp"
},
"mux": {
"enabled": false,
"concurrency": -1
}
},
{
"tag": "direct",
"protocol": "freedom",
"settings": {}
},
{
"tag": "block",
"protocol": "blackhole",
"settings": {}
}
],
"dns": {
"nameServer": [
{
"address": {
"address": "223.5.5.5",
"port": 53
},
"prioritizedDomain": [
{
"type": "Full",
"domain": "geosite:geolocation-cn"
}
]
},
{
"address": {
"address": "1.1.1.1",
"port": 53
}
},
{
"address": {
"address": "8.8.8.8",
"port": 53
}
},
{
"address": {
"address": "https://dns.google/dns-query"
}
}
]
},
"router": {
"domainStrategy": "AsIs",
"rule": [
{
"tag": "block",
"sourcePortList": "443",
"networks": "udp"
},
{
"tag": "block",
"geoDomain": [
{
"code": "category-ads-all"
}
]
},
{
"tag": "direct",
"geoDomain": [
{
"code": "cn"
},
{
"code": "geolocation-cn"
}
]
},
{
"tag": "direct",
"ip": [
"223.5.5.5"
],
"geoip": [
{
"code": "private"
},
{
"code": "cn"
}
]
},
{
"tag": "proxy",
"sourcePortList": "0-65535"
}
]
}
} |
Beta Was this translation helpful? Give feedback.
Answered by
LuciusKyle
Aug 15, 2025
Replies: 2 comments
-
|
好像不支持 |
Beta Was this translation helpful? Give feedback.
0 replies
-
{
"log": {
// ...
},
"inbounds": [
// ...
],
"outbounds": [
// ...
],
"router": {
// ...
},
"dns": {
// "domainMatcher": "mph",
// "fallbackStrategy": "DisabledIfAnyMatch",
"nameServer": [
{
"address": {
"address": "223.5.5.5"
},
"geoDomain": [
{
"code": "cn"
},
{
"code": "geolocation-cn"
}
]
},
{
"address": {
"address": "8.8.8.8"
},
"geoDomain": [
{
"code": "apple"
},
{
"code": "microsoft"
}
]
},
{
"address": {
"address": "8.8.4.4"
},
"geoDomain": [
{
"code": "google"
}
]
},
{
"address": {
"address": "1.1.1.1"
}
}
]
}
}这样, 国内的域名用223.5.5.5查, 苹果和微软相关的域名用8.8.8.8, Google相关的用8.8.4.4, 其他域名都用1.1.1.1查. |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
minusmulticoloredper
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
{ "log": { // ... }, "inbounds": [ // ... ], "outbounds": [ // ... ], "router": { // ... }, "dns": { // "domainMatcher": "mph", // "fallbackStrategy": "DisabledIfAnyMatch", "nameServer": [ { "address": { "address": "223.5.5.5" }, "geoDomain": [ { "code": "cn" }, { "code": "geolocation-cn" } ] }, { "address": { "address": "8.8.8.8" }, "geoDomain": [ { "code": "apple" }, { "code": "microsoft" } ] }, {