Skip to content

Xray leaks DNS requests with invalid domain names #2924

Description

@soft2046

I have this following config:
{
"inbounds": [
{
"listen": "127.0.0.1",
"port": 8122,
"protocol": "socks",
"settings": {
"udp": true
}
}
],
"outbounds": [
{
"sendThrough": "10.202.0.2",
"protocol": "freedom",
"settings": {
"domainStrategy": "useIP"
}
}
],
"dns": {
"servers": [
{
"address": "10.202.0.1", # my VPN DNS
"queryStrategy": "UseIPv4"
}
]
},
"log": {
"loglevel": "debug",
"dnsLog": true
}
}

In the config, only my VPN DNS server 10.202.0.1 is specified in the dns servers settings. In my PC, the system DNS has been set to 192.168.1.1 and it recognizes this private hostname this_unknown_host.com but my VPN DNS does not recognize this_unknown_host.com. In the Xray debug log, Xray attempted to resolve this_unknown_host.com by 10.202.0.1 and correctly got an unknown hostname response. However, Xray proceeded to fetch the page at this_unknown_host.com and got its page anyway after looking up from my system DNS server 192.168.1.1. I expect that Xray should see the unknown hostname response from 10.202.0.1 and abort the request without querying 192.168.1.1.

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