-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DNS servers with same tag in a SINGLE configuration file got unexpected merged #2981
Comments
What are your reproduction steps for |
The actual effective configuration is exported by adding stdout print code before+after config load. From what I have seen, the issue reported here can be easily reproduced with v4 JSON config format. |
@povsister Can reproduce with However, dns tags do not work this way. The tag is only used for routing, and not participating in DNS server selection. It should be more like a bug with the parsing logic of Can you check whether you can get expected behavior without any sorts of merging, just run with the config as-is? |
I know exactly what i am doing. I have read the code of DNS processing, and I am sure those 2 domestic servers will be used in sequence for domestic sites.
I agree with that, too.
I am using a workaround right now, by configuring different tag on different servers. {
// omitted
"dns": {
"queryStrategy": "UseIPv4",
"fallbackStrategy": "disabled-if-any-match",
"domainMatcher": "mph",
"servers": [
{
"address": "aaa.bbb.ccc.ddd", // DNS from ISP
"port": 53,
"domains": [
"geosite:cn"
],
"tag": "dns-domestic"
},
{
"address": "114.114.114.114", // 114 public DNS as backup
"port": 53,
"domains": [
"geosite:cn"
],
"tag": "dns-domestic-backup", // <- WORKAROUND HERE
},
{
"address": "https://1.1.1.1/dns-query", // Cloudflare DoH as default fallback
"tag": "dns-international",
}
]
},
"routing": {
"domainStrategy": "IPIfNonMatch",
"domainMatcher": "mph",
"rules": [
// omitted
{
"type": "field",
"inboundTag": ["dns-domestic", "dns-domestic-backup"], // <- Don't forget to add tag here.
"outboundTag": "direct" // always direct sent domestic site DNS queries
},
{
"type": "field",
"inboundTag": "dns-international",
"outboundTag": "proxy" // proxy international cf DoH queries
}
// omitted
]
}
// omitted
} |
See it. I would seek some time to look into the code and propose a fix for it. |
What version of V2Ray are you using?
master build
V2Ray 5.15.1 (V2Fly, a community-driven edition of V2Ray.) Custom (go1.22.2 linux/amd64)
What's your scenario of using V2Ray?
Not related
What problems have you encountered?
Multiple DNS servers with same tag in a single configuration file are unexpected merged into one, with all domain rules merged together, and the last server's address & settings taken effect.
What's your expectation?
According to documentation here, same-tag-merging in slices should only take effect on
inbounds
andoutbounds
.so DNS servers with same tag in a single configuration file should be all preserved.
Please attach your configuration here
What I typed in v4 configuration:
What I actually got after configuration parsed:
The text was updated successfully, but these errors were encountered: