Set the server's IP at the registrar
For a domain to open the site on your server, it needs an A record with the server's IP address. A domain's records are kept where the domain is served: usually at the registrar you bought it from. We don't host DNS zones for domains, so add the records in the registrar's control panel (or in Cloudflare, if the domain is connected to it).
Add two records of type A, both with the server's IP address as the value:
- named
@— for the domain itself; - named
www— for the address with www.
The server's IP address is on its page in the control panel, in the IP Addresses widget. For a subdomain, add one more A record with its name, for example shop.
If the server has an IPv6 subnet and the site should open over IPv6, add the same records of type AAAA.
Check that the domain points to the server
After changing the records you have to wait: a few minutes is usually enough, but sometimes it takes up to a day. You can check it like this:
dig +short example.com
The command should print your server's IP. On Windows, use nslookup example.com instead. If it prints the old address or nothing, the record hasn't updated yet or is wrong.
To test the site before the records update, add the domain to the hosts file on your computer: SERVER-IP example.com. Don't forget to remove the line afterwards.
Issue a Let's Encrypt certificate
A free Let's Encrypt certificate is issued only when the domain already points to the server and port 80 is open. So first make sure the check above shows your server's IP.
In a control panel. In Hestia, open the domain in the Web section, turn on Enable SSL for this domain and Use Let's Encrypt to obtain SSL certificate, then save. Other panels (FastPanel, ISPmanager, DirectAdmin) also have a free Let's Encrypt certificate in the domain settings. The panel renews the certificate by itself.
Without a panel, on nginx. Install certbot and issue a certificate for the domain and www:
apt install certbot python3-certbot-nginx
certbot --nginx -d example.com -d www.example.com
For Apache, install the python3-certbot-apache package and use the --apache option. Certbot adds the certificate to the site's configuration by itself. To have the site send visitors from http to https right away, add the --redirect option to the command. The certificate renews automatically, and you can test the renewal with:
certbot renew --dry-run
If the certificate won't issue
- The domain points elsewhere. Run
dig +shortfor the domain and forwww. If even one of the names points to another address, the check fails. - Port 80 is closed. Let's Encrypt checks the domain over http. Open port 80 in the firewall, even if the site will only work over https.
- Too many failed attempts. After several failures in a row, Let's Encrypt blocks issuing for the domain for a while. Fix the cause and try again in an hour.
- The domain is behind Cloudflare. If proxying is on for the record (the orange cloud), the panel may fail the check. Turn proxying off for a moment, issue the certificate and turn it back on.
The site opens without https or the browser complains
- The site opens over http. The certificate may well be there, there's just no redirect from http to https. Turn it on in the domain settings in the panel or run certbot again with the
--redirectoption. - The browser says the certificate has expired. Automatic renewal didn't work. Renew the certificate in the panel or with
certbot renewand see what error it shows. - The browser says the connection isn't secure. Most likely the site has a self-signed certificate, which panels create by default. Replace it with a Let's Encrypt certificate.
- Error 526 in Cloudflare. Cloudflare doesn't accept the certificate on the server: it has expired, or it's self-signed while SSL mode is Full (strict). Issue a valid certificate on the server.
Reverse record (PTR)
A PTR record links an IP address to a name and is needed mostly for mail. It's set not at the registrar but in our control panel: IP addresses and rDNS.
If something doesn't work, contact support and tell us the server and the domain.
