mirror of
https://github.com/miantiao-me/DNS.Surf.git
synced 2026-02-17 22:38:44 +01:00
Querying DNS Resolution Results in Different Regions Worldwide.
https://DNS.Surf
| .github | ||
| .vscode | ||
| api | ||
| app | ||
| assets | ||
| components | ||
| config | ||
| lib | ||
| public | ||
| scripts | ||
| .cursorrules | ||
| .dev.vars.example | ||
| .editorconfig | ||
| .env.example | ||
| .gitignore | ||
| .node-version | ||
| .prettierrc | ||
| CODE_OF_CONDUCT.md | ||
| components.json | ||
| doh.json | ||
| eslint.config.mjs | ||
| LICENSE | ||
| mdx-components.tsx | ||
| next-env.d.ts | ||
| next.config.mjs | ||
| package.json | ||
| pnpm-lock.yaml | ||
| postcss.config.js | ||
| README.md | ||
| README.zh-cn.md | ||
| tailwind.config.mjs | ||
| tsconfig.json | ||
| vercel.json | ||
| wrangler.toml | ||
DNS.Surf
Querying DNS Resolution Results in Different Regions Worldwide.
English | 简体中文
Demo
Vercel https://vercel.dns.surf
Cloudflare https://cloudflare.dns.surf
How It Works
Vercel
Vercel's Edge Functions support custom deployment regions. By querying DNS records through DoH, we can obtain global DNS resolution results. Theoretically supports 18 countries or regions.
Cloudflare
Cloudflare Workers are deployed globally. By accessing Workers in specific regions and using DoH to query DNS records, we can obtain global DNS resolution results. Theoretically supports 120+ countries and 330+ cities.
Deployment
Supports deployment to either Vercel or Cloudflare, independently.
Deploy to Vercel
- Fork the project to your GitHub
- Create a new project on Vercel
- Select the DNS.Surf project and
Next.jsframework - Save and deploy
- Bind a domain (optional)
Deploy to Cloudflare
- Fork the project to your GitHub
- Create a Worker locally using
npm run deploy -- --var "CORS_ORIGIN:dns.surf" "WORKER_HOST:dns.html.zone". Please modify the variable value:$CORS_ORIGINto the domain name of your web page for cross-origin verification, and$WORKER_HOSTto the access domain name of your Worker for source retrieval. - Link the Worker to GitHub in Cloudflare Dashboard and configure build script
npm run deploy -- --var "CORS_ORIGIN:dns.surf" "WORKER_HOST:dns.html.zone" - Configure DNS resolution
- After copying the ENV file locally using
cp .env.example .env - Modify
WORKER_HOSTto the access domain of the Worker,CLOUDFLARE_ZONE_IDto the ID of the domain's ZONE, andCLOUDFLARE_API_TOKENto the Cloudflare API Token, which needs permissions for 'reading user information', 'editing Workers', and 'editing DNS' - Then use
npm run cf-dnsto configure DNS resolution.
- After copying the ENV file locally using
- Create a new Pages project on Cloudflare
- Select the DNS.Surf project and
Next.js(static)framework - Set environment variables and deploy
- Bind a domain (optional)
Development
Vercel Version
pnpm install
pnpm run local
Cloudflare Version
Backend:
cp .dev.vars.example dev.vars
# ↑ Modify WORKER_HOST to your Worker's access domain for remote access
pnpm install
pnpm run worker
Frontend:
cp .env.example .env
# ↑ Modify NEXT_PUBLIC_CLOUDFLARE_WORKER_HOST to your Worker's URL for remote access
pnpm run dev
