Querying DNS Resolution Results in Different Regions Worldwide. https://DNS.Surf
Find a file
2025-07-13 09:24:54 +08:00
.github buy_me_a_coffee 2025-04-13 12:22:20 +08:00
.vscode chore: eslint 2024-09-29 23:07:29 +08:00
api refactor(dns): simplify region-specific DNS query handling and routing 2024-10-11 20:11:45 +08:00
app chore: nextjs 15 2024-12-29 13:58:53 +08:00
assets feat: init 2024-08-17 21:11:23 +08:00
components chore: update social media and blog links 2024-12-29 14:05:25 +08:00
config chore: update Cloudflare regional IP addresses 2025-06-02 16:12:59 +08:00
lib feat: add colo information to region API response 2025-02-03 15:48:05 +08:00
public feat: remove outdated favicon to improve site performance 2024-09-24 21:30:32 +08:00
scripts fix(network): update region IPs and retry settings 2025-04-12 14:16:46 +08:00
.cursorrules feat: add coding standards and best practices for project 2024-09-24 21:15:11 +08:00
.dev.vars.example feat: enhance deployment options and documentation clarity 2024-09-30 12:14:22 +08:00
.editorconfig feat: init 2024-08-17 21:11:23 +08:00
.env.example feat: Merge to Cloudflare Worker 2025-07-13 09:24:54 +08:00
.gitignore feat: support cloudflare 2024-09-28 00:28:06 +08:00
.node-version refactor: update Node version and modernize config imports 2024-12-22 19:05:51 +08:00
.prettierrc feat: init 2024-08-17 21:11:23 +08:00
CODE_OF_CONDUCT.md feat: add Contributor Covenant Code of Conduct 2024-10-18 12:05:39 +08:00
components.json chore: eslint 2024-09-29 23:07:29 +08:00
doh.json chore: eslint 2024-09-29 23:07:29 +08:00
eslint.config.mjs feat: persist selected tab across sessions for better user experience 2024-11-02 16:52:14 +08:00
LICENSE feat: init 2024-08-17 21:11:23 +08:00
mdx-components.tsx chore: eslint 2024-09-29 23:07:29 +08:00
next-env.d.ts chore: nextjs 15 2024-12-29 13:58:53 +08:00
next.config.mjs chore: nextjs 15 2024-12-29 13:58:53 +08:00
package.json chore: nextjs 15 2024-12-29 13:58:53 +08:00
pnpm-lock.yaml chore: nextjs 15 2024-12-29 13:58:53 +08:00
postcss.config.js chore: eslint 2024-09-29 23:07:29 +08:00
README.md chore: update social media and blog links 2024-12-29 14:05:25 +08:00
README.zh-cn.md fix(readme): update twitter profile link 2024-12-14 21:16:48 +08:00
tailwind.config.mjs refactor: update Node version and modernize config imports 2024-12-22 19:05:51 +08:00
tsconfig.json chore: nextjs 15 2024-12-29 13:58:53 +08:00
vercel.json chore: update Cloudflare IP and script imports 2024-09-30 18:26:57 +08:00
wrangler.toml feat: Merge to Cloudflare Worker 2025-07-13 09:24:54 +08:00

DNS.Surf

Querying DNS Resolution Results in Different Regions Worldwide.

DNS.Surf


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

  1. Fork the project to your GitHub
  2. Create a new project on Vercel
  3. Select the DNS.Surf project and Next.js framework
  4. Save and deploy
  5. Bind a domain (optional)

Deploy to Cloudflare

  1. Fork the project to your GitHub
  2. Create a Worker locally using npm run deploy -- --var "CORS_ORIGIN:dns.surf" "WORKER_HOST:dns.html.zone". Please modify the variable value: $CORS_ORIGIN to the domain name of your web page for cross-origin verification, and $WORKER_HOST to the access domain name of your Worker for source retrieval.
  3. 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"
  4. Configure DNS resolution
    1. After copying the ENV file locally using cp .env.example .env
    2. Modify WORKER_HOST to the access domain of the Worker, CLOUDFLARE_ZONE_ID to the ID of the domain's ZONE, and CLOUDFLARE_API_TOKEN to the Cloudflare API Token, which needs permissions for 'reading user information', 'editing Workers', and 'editing DNS'
    3. Then use npm run cf-dns to configure DNS resolution.
  5. Create a new Pages project on Cloudflare
  6. Select the DNS.Surf project and Next.js(static) framework
  7. Set environment variables and deploy
  8. 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

Sponsorship

  1. Follow me on 𝕏
  2. Sponsor me on GitHub