Domains & DNS

Connecting a Domain to Hosting

25 דק׳

The general process

  1. Add the domain in your hosting dashboard first; it tells you exactly which records to create.
  2. Create those records at your DNS host.
  3. Wait for DNS to resolve (minutes, sometimes longer), then the host issues an HTTPS certificate.
  4. Set one canonical URL and redirect the rest.

Typical records by host

Host www Apex
Render CNAME to your onrender.com hostname A record / ALIAS as shown in the dashboard
Vercel CNAME to the target Vercel shows A record / ALIAS as shown in the dashboard
VPS A record to the server IP A record to the server IP

Always use the values your host's dashboard displays; they can differ per account and change over time.

HTTPS

Platforms issue free certificates automatically (Let's Encrypt or similar) once DNS points to them. On a VPS, Caddy does this automatically, or use Certbot with Nginx. If issuance fails, check: the records point to the right place, no old AAAA record points elsewhere, and any CAA record allows the issuing authority.

Canonical URL and redirects

Choose https://www.example.com or https://example.com. Redirect:

  • http:// → https://
  • the non-canonical host → the canonical host

with permanent (301/308) redirects. Duplicate versions split SEO ranking and can break cookies.

Cloudflare proxy (orange cloud)

If you use Cloudflare's proxy in front of a platform, set SSL mode to Full (strict) so traffic is encrypted all the way to the origin. "Flexible" mode sends unencrypted traffic to your server and can cause redirect loops.

Exercise

Connect a domain to a deployed app, confirm HTTPS on both apex and www, redirect to the canonical host and check with curl -I that each variant returns the expected redirect.

Check yourself

  • Why add the domain in the hosting dashboard first?
  • What can block certificate issuance?
  • Which Cloudflare SSL mode should you use with a proxied origin?

ההתקדמות שלכם נשמרת בדפדפן הזה בלבד.

שליחה לבדיקה (10 נקודות)