Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ccbikai/dns.surf
Querying DNS Resolution Results in Different Regions Worldwide.
https://github.com/ccbikai/dns.surf
dns doh hacktoberfest nextjs vercel
Last synced: 7 days ago
JSON representation
Querying DNS Resolution Results in Different Regions Worldwide.
- Host: GitHub
- URL: https://github.com/ccbikai/dns.surf
- Owner: ccbikai
- License: agpl-3.0
- Created: 2024-08-17T13:08:52.000Z (3 months ago)
- Default Branch: master
- Last Pushed: 2024-10-18T04:10:35.000Z (19 days ago)
- Last Synced: 2024-10-20T14:49:49.063Z (17 days ago)
- Topics: dns, doh, hacktoberfest, nextjs, vercel
- Language: TypeScript
- Homepage: https://DNS.Surf
- Size: 733 KB
- Stars: 257
- Watchers: 1
- Forks: 42
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# DNS.Surf
**Querying DNS Resolution Results in Different Regions Worldwide.**
![DNS.Surf](./public/banner.png)
---
English | [简体中文](./README.zh-cn.md)
## Demo
**Vercel**
**Cloudflare**
## 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](https://github.com/ccbikai/DNS.Surf/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](https://github.com/ccbikai/DNS.Surf/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
```sh
pnpm install
pnpm run local
```### Cloudflare Version
Backend:
```sh
cp .dev.vars.example dev.vars
# ↑ Modify WORKER_HOST to your Worker's access domain for remote access
pnpm install
pnpm run worker
```Frontend:
```sh
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 𝕏](https://x.com/0xKaiBi)
2. [Sponsor me on GitHub](https://github.com/sponsors/ccbikai)