Skip to content

How can I prevent DNS leaks? (Windows 11) #82

Closed as not planned
Closed as not planned

Description

@serkanarisoy

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)

Image

Activity

  1. serkanarisoy commented on Jul 7, 2026

    @serkanarisoy
    Author
    Image

    DNS leak results for reference

  2. added
    bug
    enhancement
    on Jul 8, 2026
  3. PhoenixNil commented on Jul 8, 2026

    @PhoenixNil
    Owner

    Yeah joined 28 minutes ago and immediately replied my issue? lmao

    dont trust this zip!!!!!

  4. Repository owner deleted a comment from serkanarisoy on Jul 8, 2026
  5. Repository owner deleted a comment from on Jul 8, 2026
  6. self-assigned this
    on Jul 8, 2026
  7. PhoenixNil commented on Jul 8, 2026

    @PhoenixNil
    Owner

    Importance level: critical I am working on resolving this issue

  8. serkanarisoy commented on Jul 8, 2026

    @serkanarisoy
    Author

    Yeah joined 28 minutes ago and immediately replied my issue? lmao

    dont trust this zip!!!!!

    Don't worry it was suspicious enough. Those bots probably hunting users of similar repos. Also thank you for your work.

  9. PhoenixNil commented on Jul 9, 2026

    @PhoenixNil
    Owner

    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!

  10. serkanarisoy commented on Jul 12, 2026

    @serkanarisoy
    Author

    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.

  11. serkanarisoy commented on Jul 13, 2026

    @serkanarisoy
    Author

    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.

  12. PhoenixNil commented on Jul 13, 2026

    @PhoenixNil
    Owner

    @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

  13. serkanarisoy commented on Jul 13, 2026

    @serkanarisoy
    Author
    Image Image Image Image Image Image Image

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugenhancement

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions