Deploy and Connect the Domain
July 16, 2026 ยท View on GitHub
This chapter copies the tested site to the server, creates DNS records, and verifies public HTTP access.
Step 1: Back Up the Current Site
If the server already hosts content, back it up before replacing anything. Record the current DNS values so they can be restored.
Step 2: Copy the Files
From the parent directory of my-first-site, replace the server address:
rsync -av --delete ./my-first-site/ user@192.0.2.10:/var/www/example.dpdns.org/
--delete removes files on the destination that are absent locally. Omit it until you have confirmed the source and destination paths.
On the server:
find /var/www/example.dpdns.org -maxdepth 2 -type f -print
sudo nginx -t
Step 3: Create DNS Records
Create these records in the external authoritative DNS service, not in the domain registration interface.
For IPv4:
Name: @
Type: A
Value: your-server-ipv4
For IPv6, only when the server is publicly reachable over IPv6:
Name: @
Type: AAAA
Value: your-server-ipv6
For www:
Name: www
Type: CNAME
Value: example.dpdns.org
Remove obsolete address records that point to old servers after the planned overlap period.
Step 4: Verify DNS
dig A example.dpdns.org
dig AAAA example.dpdns.org
dig CNAME www.example.dpdns.org
The answers must match the server paths that actually work. Test IPv4 and IPv6 separately when both are published.
Step 5: Verify HTTP
curl -I http://example.dpdns.org
curl -I http://www.example.dpdns.org
Both names should reach the intended server. A successful DNS query followed by an HTTP timeout usually indicates a server, firewall, or routing problem.
Step 6: Choose the Canonical Hostname
Choose either the registered domain or www as the primary public URL. Redirect the other at the web server after HTTPS is configured for both names.
Rollback
If the new deployment fails:
- Restore the previous DNS value or server files.
- Keep the old service running until cached DNS answers expire.
- Record the failure evidence before retrying.
Continue to Enable and Verify HTTPS.