通配符 DNS 设置
Wildcard DNS allows tenant subdomains like acme.yourdomain.com, techcorp.yourdomain.com, etc. This is optional — FeedbackPulse works fine with slug-based URLs (e.g., /wall/acme-corp) without wildcard DNS.
Do I Need Wildcard DNS?
| Scenario | Wildcard DNS needed? |
|---|---|
Tenants use slug-based public pages (/wall/acme-corp) | No |
Tenants want their own subdomain (acme.yourdomain.com) | Yes |
Tenants bring their own 自定义域名 (feedback.acme.com) | No (use CNAME instead) |
What You Need
- A wildcard DNS A record:
*.yourdomain.com→ your server IP - A wildcard SSL certificate: covers
*.yourdomain.com - Web server configuration: accepts all subdomains
Step 1: Add the DNS Record
前往 your domain registrar's DNS management panel and add:
| Type | Name/Host | Value | TTL |
|---|---|---|---|
| A | * | 123.456.789.0 (your server IP) | 300 |
You also need the regular A record for the root domain:
Type Name/Host Value A @123.456.789.0
Provider-Specific Instructions
Cloudflare
- 登录 to Cloudflare 仪表板
- Select your domain
- 前往 DNS → Records
- Click Add Record
- Type:
A| Name:*| IPv4: your server IP | Proxy: DNS only (gray cloud) - Click Save
重要: For wildcard subdomains, set Cloudflare proxy to DNS only (gray cloud), not Proxied (orange cloud). Cloudflare's free plan doesn't proxy wildcard subdomains.
Namecheap
- 登录 → Domain List → Manage your domain
- 前往 Advanced DNS
- Click Add New Record
- Type:
A Record| Host:*| Value: your server IP | TTL: Automatic - Save
GoDaddy
- 登录 → My 产品 → DNS for your domain
- Click Add Record
- Type:
A| Name:*| Value: your server IP | TTL: 600 - Save
Google Domains / Google Cloud DNS
- 前往 Google Domains
- Select your domain → DNS
- Under Custom Records, add:
- Host:
*| Type:A| Data: your server IP - Save
AWS Route 53
- 前往 Route 53 → Hosted Zones → select your domain
- Click Create Record
- Record name:
*| Record type:A - Value: your server IP | TTL:
300 - Click Create Records
DigitalOcean DNS
- 前往 Networking → Domains
- Select your domain
- Add: Type
A| Hostname*| Will direct to: your server IP | TTL:300
Hetzner DNS
- 前往 Hetzner DNS Console
- Select your zone
- Add record: Type
A| Name*| Value: your server IP
Step 2: Get a Wildcard SSL Certificate
Option A: Let's Encrypt with DNS Challenge (Free)
Wildcard certificates from Let's Encrypt require DNS-01 challenge (not HTTP):
# Install Certbot with DNS plugin for your provider
# Example: Cloudflare
sudo apt install certbot python3-certbot-dns-cloudflare
# Create Cloudflare credentials file
sudo mkdir -p /etc/letsencrypt
sudo nano /etc/letsencrypt/cloudflare.ini
Add your Cloudflare API token:
dns_cloudflare_api_token = your_cloudflare_api_token_here
sudo chmod 600 /etc/letsencrypt/cloudflare.ini
# Get wildcard certificate
sudo certbot certonly \
--dns-cloudflare \
--dns-cloudflare-credentials /etc/letsencrypt/cloudflare.ini \
-d yourdomain.com \
-d "*.yourdomain.com"
DNS Plugins for Other Providers
| Provider | Certbot Plugin | Install |
|---|---|---|
| Cloudflare | python3-certbot-dns-cloudflare | sudo apt install python3-certbot-dns-cloudflare |
| Route 53 | python3-certbot-dns-route53 | sudo apt install python3-certbot-dns-route53 |
| DigitalOcean | python3-certbot-dns-digitalocean | sudo apt install python3-certbot-dns-digitalocean |
| Google Cloud | python3-certbot-dns-google | sudo apt install python3-certbot-dns-google |
Option B: Manual DNS Challenge
If your DNS provider doesn't have a Certbot plugin:
sudo certbot certonly --manual --preferred-challenges dns \
-d yourdomain.com -d "*.yourdomain.com"
Certbot will ask you to create a TXT record. Follow the prompts.
Manual challenge caveat: You'll need to manually renew every 90 days and update the DNS TXT record each time.