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
Obex DNS is a lightweight, scalable, and privacy-focused DNS resolution system. It runs entirely on Cloudflare's edge network, leveraging the ultra-fast response of Workers and the efficient storage of D1 database to provide users with a granular DNS control experience.
What is DNS over HTTPS (DoH)?
DoH (RFC 8484) is a protocol for performing DNS queries via encrypted HTTPS connections. Compared to traditional plaintext DNS, DoH can:
Prevent Hijacking: Prevents ISPs or third parties from tampering with DNS responses.
Enhance Privacy: Hides your browsing history through an encrypted tunnel.
Bypass Censorship: Provides more stable resolution in restricted network environments.
✨ Core Features
🚀 Ultra-fast Resolution: Fully based on edge computing with extremely low global latency.
Multi-profile Management: Supports creating multiple independent configurations, each with a unique endpoint.
🛡️ Granular Filtering:
Allow/Block Lists: Supports exact domain and subdomain wildcard matching.
Third-party Rule Sets: Supports subscribing to external blocklists in formats like AdGuard.
Custom Redirection: Supports custom overrides for A, AAAA, TXT, and CNAME records.
📊 Real-time Stats & Logs: Visual dashboard recording every request's hit reason, geo-location, and upstream latency.
When a DNS request arrives, it goes through the following processing stages:
Memory Cache Check: Checks if a valid response for the query exists in the edge node's memory.
Config Loading: Layers profile settings loading from Memory -> Cache API -> D1 Database.
Local Rule Matching:
Whitelist: If hit, forwards directly to upstream and returns.
Redirection: If hit, returns custom records.
Blacklist: If hit, returns NXDOMAIN.
External List Filtering:
Use a Bloom filter for fast filtering.
Upstream Resolution: If none of the above hit, requests the upstream DoH server based on configuration, with optional ECS support.
Async Logging & Caching: Asynchronously records resolution logs, fetches target GeoIP, and writes results to various cache levels.
🚀 Deployment Guide
Development Environment
Node.js: v18.x or later
Package Manager: npm
Cloudflare Account: Workers and D1 permissions required
Local Development
Clone the repository and install dependencies:
npm install
Initialize D1 Database:
npm run db:setup
npm run db:migrate
Start the development server:
npm run dev
Deploy online
npm run deploy
Online Deployment (Cloudflare Dashboard)
Fork this repo: Click the Fork button at the top right to clone the repository to your own GitHub account.
Create D1 Database: Log in to the Cloudflare dashboard, go to Workers & Pages > D1, and create a new database (e.g., named obex_db), and copy the created database ID.
Configure Database ID: In your forked repository, edit the wrangler.toml file and replace database_id with the ID of the database you just created.
Create Worker: Go to Cloudflare dashboard Workers & Pages > Create application > Create Worker.
Import from GitHub: On the deployment page, select Deploy from GitHub, connect your forked project, and complete the authorized deployment.