[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-107602":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":14,"contributorsCount":15,"subscribersCount":15,"size":15,"stars1d":15,"stars7d":14,"stars30d":16,"stars90d":15,"forks30d":15,"starsTrendScore":15,"compositeScore":17,"rankGlobal":10,"rankLanguage":10,"license":18,"archived":19,"fork":19,"defaultBranch":20,"hasWiki":21,"hasPages":19,"topics":22,"createdAt":10,"pushedAt":27,"updatedAt":28,"readmeContent":29,"aiSummary":30,"trendingCount":15,"starSnapshotCount":15,"syncStatus":16,"lastSyncTime":31,"discoverSource":32},107602,"loophole","eyalm2000\u002Floophole","eyalm2000","Experimental DNS-over-HTTPS on Android with Private DNS","",null,"TypeScript",55,10,1,0,2,43.82,"MIT License",false,"main",true,[23,24,25,26],"adb","dns","dns-over-https","private-dns","2026-10-24 19:54:35","2026-11-23 13:34:42","# Loophole\n\n## Overview\n\nLoophole gives Android's Private DNS a DNS-over-HTTPS endpoint it can discover on its own, so system-wide encrypted DNS keeps working on networks that block port 853. It is a Cloudflare Worker you deploy to your own account, plus documentation for the Android flags that make discovery work. No VPN, no root.\n\n## Why a gateway is needed\n\nAndroid's Private DNS connects over DNS-over-TLS on port 853. On networks that block that port (university Wi-Fi, hotels, airports, some workplaces), it stops working entirely. What happens on such a network depends on which group your provider is in.\n\nWith the flags on, Android discovers DoH endpoints itself through DDR: it looks up a special SVCB DNS record named `_dns.\u003Chostname>` before connecting, and if that record advertises a DoH path, Android skips port 853 and talks DoH, usually over HTTP\u002F3.\n\n| Group                   | Providers                                                                             | On a network that blocks port 853                             |\n| ----------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------- |\n| Hardcoded into Android  | Google (dns.google), Cloudflare (cloudflare-dns.com)                                  | DoH works, no flags needed                                    |\n| Works without the flags | All providers with a DoT endpoint (stock Private DNS)                                 | Works only where port 853 is open; breaks where it is blocked |\n| Works with the flags    | Quad9 (dns.quad9.net) and other supported providers                                   | DoH works via DDR                                             |\n| Not supported           | NextDNS, AdGuard DNS, Control D, OpenDNS, CleanBrowsing, Mullvad DNS, and most others | Fails even with the flags; needs the worker                   |\n\nAmong major DNS services, Quad9 is the only one that supports DDR and needs the flag turned on. Google and Cloudflare do not need it because they are hardcoded. Most DNS services do not publish DDR records at all.\n\nThat is what this worker is for: it gives you a DoH endpoint on your own domain, and you publish the SVCB record for it. Android then discovers your gateway the same way it discovers Quad9's, and your gateway forwards queries to whatever upstream you configured. The filtering service never needs to support DDR itself.\n\n## Getting Started\n\n### 1. Guided setup (recommended)\n\nUse this if you want the worker. Requires Android 16 or later, and a domain.\n\n[![Deploy to Cloudflare Workers](https:\u002F\u002Fdeploy.workers.cloudflare.com\u002Fbutton)](https:\u002F\u002Fdeploy.workers.cloudflare.com\u002F?url=https:\u002F\u002Fgithub.com\u002Feyalm2000\u002Floophole)\n\n1. Click the button above.\n2. Log in to Cloudflare (a free account is fine).\n3. Select your GitHub account and keep the other settings on their defaults, then click Deploy.\n4. When it finishes, click Visit, and follow the instructions from there.\n\nThe Cloudflare free plan is enough for personal use (100,000 requests per day), and the Worker runs on Cloudflare's edge, so it adds minimal latency to your queries.\n\n### 2. Flags only\n\nUse this if your provider publishes DDR records (Quad9 and other supported providers) and you do not need a worker. Requires Android 16 or later.\n\nRun the two commands in [Enable the flags](#enable-the-flags) below, set your Private DNS hostname to your provider's hostname (for example `dns.quad9.net`), and toggle airplane mode.\n\n### 3. Your own DoH endpoint or DNS\n\nUse this if you already run a DoH endpoint or your own DNS. Requires a DoH endpoint and control of its DNS zone.\n\nYou need one DNS record. In your domain's DNS zone (wherever your domain's DNS is hosted), add a record with these fields:\n\n- Type: SVCB\n- Name: `_dns.\u003Cyour-hostname>` (the exact hostname you will enter in Private DNS, with `_dns.` in front)\n- Priority: 1\n- TTL: Auto\n- Target: `\u003Cyour-hostname>.` (your DoH server's hostname, with a trailing dot)\n- Parameters: `alpn=\"h3\" dohpath=\"\u002Fdns-query{?dns}\"`\n\nSo for a hostname like `dns.example.com`, the record is: name `_dns.dns.example.com`, target `dns.example.com.`, parameters `alpn=\"h3\" dohpath=\"\u002Fdns-query{?dns}\"`.\n\nAdjust two things to match your server: if it does not serve HTTP\u002F3, use `alpn=\"h2\"` (or `alpn=\"h2,h3\"` if it serves both); if your DoH path is not `\u002Fdns-query`, put your path in `dohpath` instead. If your endpoint runs on a port other than 443, add `port=\u003Cnumber>` to the parameters.\n\nThen check the record is actually published before testing on your phone. From any terminal:\n\n```text\ndig _dns.\u003Cyour-hostname> SVCB\n```\n\nWait for the record to show up: DNS changes can take a few minutes to propagate. After that, run the commands in [Enable the flags](#enable-the-flags), set your Private DNS hostname to your hostname, and toggle airplane mode. No Loophole worker is involved.\n\n## Enable the flags\n\nYou need Shizuku (on the phone, no computer) or ADB (from a computer).\n\n**Shizuku:** install [Shizuku](https:\u002F\u002Fshizuku.rikka.app\u002Fdownload\u002F), pair it through wireless debugging, then install [aShell You](https:\u002F\u002Fgithub.com\u002FDP-Hridayan\u002FaShellYou) and allow it Shizuku access. Run the commands below there, exactly as written.\n\n**ADB:** install [Android Platform Tools](https:\u002F\u002Fdeveloper.android.com\u002Ftools\u002Freleases\u002Fplatform-tools), enable Developer options and USB debugging, connect by USB, and run `adb devices` to confirm your phone shows up. In Windows PowerShell, use `.\\adb` instead of `adb`.\n\nRun each command separately. A successful command usually prints nothing. The commands are written with the `adb shell` prefix, which works the same in a computer terminal and in aShell You, so copy them as they are.\n\n```text\nadb shell device_config put connectivity dns_ddr_version 1\nadb shell device_config put connectivity networkmonitor_async_privdns_resolution 1\n```\n\n**Required last step: turn airplane mode on, wait a few seconds, then turn it off.** Android only applies the change after a reconnect. Without this, setup will not work.\n\nCheck that both settings stuck (each should return `1`):\n\n```text\nadb shell device_config get connectivity dns_ddr_version\nadb shell device_config get connectivity networkmonitor_async_privdns_resolution\n```\n\nIf the settings keep resetting, this disables DeviceConfig synchronization for the whole phone. Use it only if needed:\n\n```text\nadb shell device_config set_sync_disabled_for_tests persistent\n```\n\nTo revert back:\n\n```text\nadb shell device_config set_sync_disabled_for_tests none\n```\n\n## Privacy & Security\n\nLoophole has no analytics, tracking, or ads.\n\n#### Query logs\n\nThe gateway does not store your queries. The dashboard's connection indicator is a live check, not a log: it only confirms whether your phone is currently routing through the gateway.\n\n#### Open endpoint\n\nThe gateway's `\u002Fdns-query` endpoint is open by design. DDR requires Android to reach it without authentication, so anyone who finds your gateway URL can send queries through it, and your upstream profile will see their traffic. Don't publish your gateway domain unless you're fine with that.\n\n#### PIN\n\nThe dashboard is protected by a 4-digit PIN you set during setup.\n\n#### Who sees your traffic\n\nYour upstream provider sees your queries as normal DNS traffic. Cloudflare hosts the Worker, so queries pass through Cloudflare's edge.\n\n## Frequently Asked Questions\n\n#### Do I need root?\n\nNo. Loophole manages system settings via Shizuku or ADB. If your device is rooted, you can start Shizuku in root mode, but root is not required.\n\n#### Does it work without a custom domain?\n\nPartly. Basic DoH and the dashboard work on a `workers.dev` address, but Android hostname discovery requires a custom domain and its SVCB record. Without the domain, Private DNS cannot discover the gateway.\n\n#### Why is the DNS endpoint open? Can't the PIN lock it?\n\nNo. DDR requires Android to reach the endpoint without authentication, so the endpoint cannot be locked. The PIN guards the dashboard only.\n\n#### Will it drain my battery or run in the background?\n\nNo. Nothing runs on the phone after setup. Private DNS is a system setting, not an app and not a VPN, so there is no background service and no battery cost.\n\n#### What if my provider adds DDR records later?\n\nThen you don't need the worker for it. Use the flags-only path with your provider's hostname, the same way Quad9 works today.\n\n## License\n\nThis project is licensed under the MIT License. See [LICENSE](LICENSE).\n","Loophole 是一个为 Android 系统提供自动发现式 DNS-over-HTTPS（DoH）网关的轻量级解决方案，用于绕过网络对 DNS-over-TLS（端口 853）的封锁。它基于 Cloudflare Workers 实现，通过部署自定义 DoH 端点并配合 SVCB 记录（DDR 机制），使 Android 在 Android 16+ 上可自主发现并切换至 DoH，无需 VPN 或 Root。核心特点是利用标准 DNS 发现协议（RFC 9460）实现系统级加密 DNS 的持续可用，上游可灵活配置任意 DNS 服务。适用于高校、酒店、机场等限制 853 端口的受限网络环境，尤其适配未原生支持 DDR 的主流 DoH 提供商（如 NextDNS、AdGuard DNS）。","2026-11-24 04:32:22","CREATED_QUERY"]