How do I link a domain to my VPS?
Create the correct DNS records, wait for propagation and configure the web server for HTTPS. The DNS directs a name to the IP.
The DNS directs a name to the IP; it does not configure the web server or the certificate. The three steps must be validated separately.
Step-by-step procedure
-
Create the DNS record
Add an A record pointing to the IPv4 address of the VPS. Use an AAAA record only if IPv6 is actually configured.
-
Check resolution
Compare the output of dig +short from several resolvers. Propagation depends on the previous TTL.
-
Configure the virtual host
Declare the domain in Caddy, Nginx or Apache and make the application listen locally behind the reverse proxy.
-
Enable HTTPS
Open 80/443 and let the web server obtain the certificate. Do not proxy a port that only listens on another interface.
Verification DNS and HTTP
dig +short app.example.com A
curl -I http://app.example.com
curl -I https://app.example.com
Name servers, resolution and ports
dig NS example.com +short
dig +short app.example.com A @1.1.1.1
ss -tlnp | grep -E ':(80|443) '
ufw allow 80,443/tcp
Before creating the record
The address to use is shown in “My services”, on the VPS page, on the “IPv4 address” line. The DNS zone, however, is not edited on the VPS: it is managed at the provider your domain’s name servers point to, usually the registrar or a service such as Cloudflare. A record created anywhere else has no effect.
- Bare domain: an A record named @ pointing to the VPS IPv4.
- Subdomain: an A record named app or www pointing to the same address.
- No AAAA record left over from a previous host: visitors on IPv6 would reach the old server.
Using the free subdomain
If you do not have a domain, each ACLClouds account can reserve a name under aclclouds.online from the “Free subdomain” page: https://aclclouds.com/dashboard/free-subdomains. The account’s e-mail address must be verified. This subdomain is only a DNS name, with no hosting space: its purpose is to point to your VPS.
Click “Add a record”, choose type A, enter @ for the name itself or a name such as app, then the VPS IPv4. The AAAA, CNAME, TXT, MX, SRV and CAA types are available too. A CNAME cannot coexist with another record on the same name. The rest of this guide then applies in exactly the same way.
Subdomain ACLClouds
Without a domain of your own, your ACLClouds account entitles you to one free subdomain under aclclouds.online, on which you create the A record to the VPS IPv4 yourself.
Frequently asked questions
Why do I get curl: (6) Could not resolve host although the record exists?
Most often, the record was created in a zone that is not the one the domain uses. Run dig NS example.com +short: the answer shows which provider is authoritative. Create the record there, or change the name servers at the registrar.
The domain still answers with the old address, what should I do?
Resolvers keep the old answer for the duration of the TTL that was in place before the change. Query a public resolver with dig +short app.example.com A @1.1.1.1: if the new address shows up there, you only have to wait for your network’s cache to expire. Before a planned change, lower the TTL in advance.
Why do I get curl: (7) Failed to connect although DNS is correct?
The name does reach the VPS, but nothing answers there on the requested port. Check with ss -tlnp that the web server is listening on 80 and 443, and not only on 127.0.0.1. If a firewall is active, allow these ports, for example with ufw allow 80,443/tcp.
Is reverse DNS set in my domain’s zone?
No. The PTR record belongs to the network that holds the IP address, not to your domain. It is not needed to serve a website: it matters mostly for sending e-mail from the VPS. If you need one, contact ACLClouds support.