You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to use Cloudflare DNS. Using Windows 11 and it leaks DNS. How can I prevent that?
**Proxy setting is "System Proxy"
-IPV6 disabled for TUN, ethernet and WI-FI adapter
-No DNS setting applied from Windows (only from xrayui-dev client)
-Theres no system modification except 65 TTL value (to bypass hotspot limit in my carrier)
-Secure DNS in browser=Cloudflare (tried with no secure DNS but still same)
Sorry, after a lot of investigation, I still haven't been able to fix this problem , dns leak in tun mode is Inevitable because it was core bug.
maybe u can switch to system proxy to avoid leak
Once the Xray core fixes this issue, I'll follow up with a fix in XrayUI as soon as possible. Thank you for your understanding and support!
Sorry, after a lot of investigation, I still haven't been able to fix this problem , dns leak in tun mode is Inevitable because it was core bug. maybe u can switch to system proxy to avoid leak Once the Xray core fixes this issue, I'll follow up with a fix in XrayUI as soon as possible. Thank you for your understanding and support!
FYI, that was my fault. I disabled "Smart Multi-Homed Name Resolution" on Windows Group Policy, configured my DNS settings to desired one and now there is no DNS leak. I tested with TUN mode enabled, System Proxy. Rest is default.
Well I think theres issue with xray-core like you've said. I decided to use Quad9 to see if it truly works and heres the results:
Smart Multi-Homed Name Resolution disabled, Browser Private DNS disabled, IPV6 disabled in app and all adapters (I even disabled IPV6 in APN settings for my carrier)
TUN mode enabled - System Proxy, Bypass System Proxy:
If you set Quad9 DNS setting from Windows Settings for your adapter (WI-FI or Ethernet), empty DNS fields in app and run DNS leak test=Cloudflare with Quad9 DNS.
If you don't set any DNS setting in Windows Settings, fill DNS fields in app with Quad9 addresses (9.9.9.9) and run DNS leak test=Cloudflare with ISP DNS
TUN mode disabled, System Proxy:
If you set Quad9 DNS setting from Windows Settings for your adapter (WI-FI or Ethernet), empty DNS fields in app and run DNS leak test=Cloudflare DNS
If you don't set any DNS setting in Windows Settings, fill DNS fields in app with Quad9 addresses (9.9.9.9) and run DNS leak test=Cloudflare DNS
TUN mode disabled, Bypass System Proxy:
If you set Quad9 DNS setting from Windows Settings for your adapter (WI-FI or Ethernet), empty DNS fields in app and run DNS leak test=Quad9 DNS
If you don't set any DNS setting in Windows Settings, fill DNS fields in app with Quad9 addresses (9.9.9.9) and run DNS leak test=Cloudflare DNS
I was using Cloudflare on my Windows DNS settings, thats why I didn't notice. Sorry for wrong feedback.
After every change did "ipconfig /flushdns" just in case.
If anyone prefers TUN with only Cloudflare DNS, just use Cloudflare DNS on Windows settings, enable TUN mode, empty DNS fields in app and set Bypass System Proxy.
If you prefer your own DNS and don't wanna depend on server or client: Disable TUN mode, set your own DNS in Windows Settings, set Bypass System Proxy and empty DNS fields in app.
This was the most stupid thing I've ever tested. There is no such a things like this in Android clients.
I don't even know what kinda fallback this is. Clients fallback DNS (Cloudflare) or 3x-ui's? For reference I don't use inbuilt DNS feature in 3x-ui panel and my VPS uses Cloudflare DNS.
This is not a professional test. Made by end user at middle of night.
No DNS setting applied from Windows. Private DNS disabled in browser. IPV6 disabled computer & hotspot phones APN settings (my cringe VPS doesn't support IPV6 either). Smart Multi-Homed Name Resolution disabled. Cleared DNS cache from Windows.
Disabled TUN mode, no DNS settings applied in app. System Proxy. Rest is default. Now it only uses VPS's default DNS. (to test I changed to Quad9 in VPS's systemd resolved configuration)
To people who uses their own xray-core server in VPS and prefer same DNS configured in VPS:
-Don't use above setup if you configure your own xray-core server and prefer same DNS. Set DOH address of your VPS's default DNS in Windows settings. Switch to Bypass System Proxy and empty DNS fields in app because it simply doesn't work. This way your DNS
queries are faster, you simply don't lose any privacy or security by doing this. There is no DNS leak in this setup either.
-TUN mode still not reliable. If I enable it, dnscheck.tools fails (idk why) no matter what kind of setup I do in Windows or App. Other things was fine but there should be some reason why dnscheck.tools fails with TUN mode miserably.
This is all from me. I don't connect my xray-core server over PC nowadays but I wanted to give all I have for those issues. I hope xray-core team will fix it. Thank you.
Activity
serkanarisoy commentedon Jul 7, 2026
DNS leak results for reference
PhoenixNil commentedon Jul 8, 2026
dont trust this zip!!!!!
PhoenixNil commentedon Jul 8, 2026
Importance level: critical I am working on resolving this issue
serkanarisoy commentedon Jul 8, 2026
Don't worry it was suspicious enough. Those bots probably hunting users of similar repos. Also thank you for your work.
PhoenixNil commentedon Jul 9, 2026
Sorry, after a lot of investigation, I still haven't been able to fix this problem , dns leak in tun mode is Inevitable because it was core bug.
maybe u can switch to system proxy to avoid leak
Once the Xray core fixes this issue, I'll follow up with a fix in XrayUI as soon as possible. Thank you for your understanding and support!
serkanarisoy commentedon Jul 12, 2026
FYI, that was my fault. I disabled "Smart Multi-Homed Name Resolution" on Windows Group Policy, configured my DNS settings to desired one and now there is no DNS leak. I tested with TUN mode enabled, System Proxy. Rest is default.
serkanarisoy commentedon Jul 13, 2026
Well I think theres issue with xray-core like you've said. I decided to use Quad9 to see if it truly works and heres the results:
Smart Multi-Homed Name Resolution disabled, Browser Private DNS disabled, IPV6 disabled in app and all adapters (I even disabled IPV6 in APN settings for my carrier)
TUN mode enabled - System Proxy, Bypass System Proxy:
If you set Quad9 DNS setting from Windows Settings for your adapter (WI-FI or Ethernet), empty DNS fields in app and run DNS leak test=Cloudflare with Quad9 DNS.
If you don't set any DNS setting in Windows Settings, fill DNS fields in app with Quad9 addresses (9.9.9.9) and run DNS leak test=Cloudflare with ISP DNS
TUN mode disabled, System Proxy:
If you set Quad9 DNS setting from Windows Settings for your adapter (WI-FI or Ethernet), empty DNS fields in app and run DNS leak test=Cloudflare DNS
If you don't set any DNS setting in Windows Settings, fill DNS fields in app with Quad9 addresses (9.9.9.9) and run DNS leak test=Cloudflare DNS
TUN mode disabled, Bypass System Proxy:
If you set Quad9 DNS setting from Windows Settings for your adapter (WI-FI or Ethernet), empty DNS fields in app and run DNS leak test=Quad9 DNS
If you don't set any DNS setting in Windows Settings, fill DNS fields in app with Quad9 addresses (9.9.9.9) and run DNS leak test=Cloudflare DNS
I was using Cloudflare on my Windows DNS settings, thats why I didn't notice. Sorry for wrong feedback.
After every change did "ipconfig /flushdns" just in case.
If anyone prefers TUN with only Cloudflare DNS, just use Cloudflare DNS on Windows settings, enable TUN mode, empty DNS fields in app and set Bypass System Proxy.
If you prefer your own DNS and don't wanna depend on server or client: Disable TUN mode, set your own DNS in Windows Settings, set Bypass System Proxy and empty DNS fields in app.
This was the most stupid thing I've ever tested. There is no such a things like this in Android clients.
I don't even know what kinda fallback this is. Clients fallback DNS (Cloudflare) or 3x-ui's? For reference I don't use inbuilt DNS feature in 3x-ui panel and my VPS uses Cloudflare DNS.
This is not a professional test. Made by end user at middle of night.
PhoenixNil commentedon Jul 13, 2026
@serkanarisoy Appreciate your tests and result. the xray-core team is Currently working on this problem u can refer this PR XTLS/Xray-core#6478
serkanarisoy commentedon Jul 13, 2026
No DNS setting applied from Windows. Private DNS disabled in browser. IPV6 disabled computer & hotspot phones APN settings (my cringe VPS doesn't support IPV6 either). Smart Multi-Homed Name Resolution disabled. Cleared DNS cache from Windows.
Disabled TUN mode, no DNS settings applied in app. System Proxy. Rest is default. Now it only uses VPS's default DNS. (to test I changed to Quad9 in VPS's systemd resolved configuration)
To people who uses their own xray-core server in VPS and prefer same DNS configured in VPS:
-Don't use above setup if you configure your own xray-core server and prefer same DNS. Set DOH address of your VPS's default DNS in Windows settings. Switch to Bypass System Proxy and empty DNS fields in app because it simply doesn't work. This way your DNS
queries are faster, you simply don't lose any privacy or security by doing this. There is no DNS leak in this setup either.
-TUN mode still not reliable. If I enable it, dnscheck.tools fails (idk why) no matter what kind of setup I do in Windows or App. Other things was fine but there should be some reason why dnscheck.tools fails with TUN mode miserably.
This is all from me. I don't connect my xray-core server over PC nowadays but I wanted to give all I have for those issues. I hope xray-core team will fix it. Thank you.