Skip to content
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

BUG: "localhost" dns always returns both ipv4 and ipv6 regardless of queryStrategy! #4278

Closed
patterniha opened this issue Jan 17, 2025 · 1 comment

Comments

@patterniha
Copy link

patterniha commented Jan 17, 2025

After I changed my internet isp the bug in example 1 in #4268 no longer occurred.
probably my isp didn't allow to use non-default udp dns and i thought the problem was with v2rayng.

but bug in example 2 still remains.
so i closed #4268 and open this separate issue for only example 2.

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

test version: 1.9.32
built-in dns server for "localhost" dns doesn't work correctly.
according to https://xtls.github.io/config/dns.html#dnsobject
after xray-core v1.8.6 built-in dns server support "global" and "per server" queryStrategy.
so according to the documentation,
for example if "global queryStrategy" is UseIP and "dns server 1 queryStrategy" is UseIPv4,
dns server 1 should only return ipv4 and final result should only contain ipv4(if for example
we have only server 1 dns server)
but if we start vpn for this config
and run for example "host cloudflare.com" command in termux(terminal)
result contains both ipv4 and ipv6!!!

*** instead of "localhost" if we use other types of dns (udp,tcp,doh,...) it works correctly. (dns query result contains only ipv4)

example config with "localhost" dns which incorrectly returns both IPv4 and ipv6: https://raw.githubusercontent.com/patterniha/xray_configs/refs/heads/main/2dust_with_bug_example_2.json

example config with "udp" dns which correctly only returns ipv4: https://raw.githubusercontent.com/patterniha/xray_configs/refs/heads/main/2dust_bug-free_example_2.json

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

localhost(system default) dns are very widely used in Iran.
because for fragment-used configs we should use domestic dns.
and because many isp don't allow to use non-default dns, we have to use "localhost" dns.

@patterniha patterniha changed the title queryStrategy has no effect on "localhost" dns "localhost" dns always returns both ipv6 and ipv4 regardless of queryStrategy! Jan 18, 2025
@patterniha patterniha changed the title "localhost" dns always returns both ipv6 and ipv4 regardless of queryStrategy! "localhost" dns always returns both ipv4 and ipv6 regardless of queryStrategy! Jan 18, 2025
@patterniha patterniha changed the title "localhost" dns always returns both ipv4 and ipv6 regardless of queryStrategy! BUG: "localhost" dns always returns both ipv4 and ipv6 regardless of queryStrategy! Jan 18, 2025
@patterniha
Copy link
Author

@2dust
after testing in my pc, I realized this bug is related to the xray-core.

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

No branches or pull requests

1 participant