Zum Hauptinhalt springen

Wildcard-DNS-Einrichtung

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?โ€‹

ScenarioWildcard 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 benutzerdefinierte Domain (feedback.acme.com)No (use CNAME instead)

What You Needโ€‹

  1. A wildcard DNS A record: *.yourdomain.com โ†’ your server IP
  2. A wildcard SSL certificate: covers *.yourdomain.com
  3. Web server configuration: accepts all subdomains

Step 1: Add the DNS Recordโ€‹

Gehen Sie zu your domain registrar's DNS management panel and add:

TypeName/HostValueTTL
A*123.456.789.0 (your server IP)300

You also need the regular A record for the root domain:

TypeName/HostValue
A@123.456.789.0

Provider-Specific Instructionsโ€‹

Cloudflareโ€‹

  1. Melden Sie sich an to Cloudflare Dashboard
  2. Select your domain
  3. Gehen Sie zu DNS โ†’ Records
  4. Click Add Record
  5. Type: A | Name: * | IPv4: your server IP | Proxy: DNS only (gray cloud)
  6. Click Save

Wichtig: 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โ€‹

  1. Melden Sie sich an โ†’ Domain List โ†’ Manage your domain
  2. Gehen Sie zu Advanced DNS
  3. Click Add New Record
  4. Type: A Record | Host: * | Value: your server IP | TTL: Automatic
  5. Save

GoDaddyโ€‹

  1. Melden Sie sich an โ†’ My Produkte โ†’ DNS for your domain
  2. Click Add Record
  3. Type: A | Name: * | Value: your server IP | TTL: 600
  4. Save

Google Domains / Google Cloud DNSโ€‹

  1. Gehen Sie zu Google Domains
  2. Select your domain โ†’ DNS
  3. Under Custom Records, add:
  4. Host: * | Type: A | Data: your server IP
  5. Save

AWS Route 53โ€‹

  1. Gehen Sie zu Route 53 โ†’ Hosted Zones โ†’ select your domain
  2. Click Create Record
  3. Record name: * | Record type: A
  4. Value: your server IP | TTL: 300
  5. Click Create Records

DigitalOcean DNSโ€‹

  1. Gehen Sie zu Networking โ†’ Domains
  2. Select your domain
  3. Add: Type A | Hostname * | Will direct to: your server IP | TTL: 300

Hetzner DNSโ€‹

  1. Gehen Sie zu Hetzner DNS Console
  2. Select your zone
  3. 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โ€‹

ProviderCertbot PluginInstall
Cloudflarepython3-certbot-dns-cloudflaresudo apt install python3-certbot-dns-cloudflare
Route 53python3-certbot-dns-route53sudo apt install python3-certbot-dns-route53
DigitalOceanpython3-certbot-dns-digitaloceansudo apt install python3-certbot-dns-digitalocean
Google Cloudpython3-certbot-dns-googlesudo 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.

Option C: Paid Wildcard Certificateโ€‹

Purchase from providers like:

  • Comodo/Sectigo (~$70/year)
  • DigiCert (~$400/year)
  • RapidSSL (~$125/year)

Step 3: Configure Your Web Serverโ€‹

See the wildcard sections in:

Key: use ServerAlias *.yourdomain.com (Apache) or server_name yourdomain.com *.yourdomain.com; (Nginx).


Step 4: Verify It Worksโ€‹

# Test DNS resolution for a subdomain
dig test.yourdomain.com

# Should return your server IP in the ANSWER section

# Test with curl
curl -I https://anything.yourdomain.com
# Should return a 200 or redirect (not "could not resolve host")

Step 5: Configure FeedbackPulseโ€‹

Update your .env file:

# Set the session domain to allow cookies across subdomains
SESSION_DOMAIN=.yourdomain.com

# Your main app URL (without subdomain)
APP_URL=https://yourdomain.com

Note the leading dot in SESSION_DOMAIN=.yourdomain.com โ€” this allows session cookies to work across all subdomains.


How Subdomains Work in FeedbackPulseโ€‹

When a request comes in to acme.yourdomain.com:

  1. The ResolveTenant middleware extracts the subdomain (acme)
  2. It looks up the tenant with subdomain = 'acme'
  3. If found, the tenant is set as the current context
  4. The user sees the tenant's login page or dashboard

Tenants set their subdomain during registration. You can also set it manually in the Admin-Panel.


Naechste Schritteโ€‹