Guides

How to point a domain at your VPS (and add HTTPS)

Two DNS records and a short wait. Which record types to use, how to verify propagation, why it is not instant, and how to add a free HTTPS certificate.

Published ~5 min read
On this page

Pointing a domain at a VPS is two DNS records and a short wait. The confusion is usually about which record type to use and why the change “is not working” five minutes later, which is almost always caching, not a mistake. Here is the whole process.

1. Get your server’s IP addresses

on the server
ip -4 addr show     # your IPv4
ip -6 addr show     # your IPv6, if assigned

2. Create the records at your DNS provider

In your registrar or DNS host’s panel, add an A record for IPv4 and, if you have one, an AAAA record for IPv6:

records
Type   Name    Value              TTL
A      @       203.0.113.10       3600
AAAA   @       2001:db8::10       3600
CNAME  www     example.com.       3600
  • @ is the root domain (example.com).
  • The www CNAME points the subdomain at the root, so both resolve.
  • Lower the TTL to 300 before a planned move so changes propagate faster.

Which panel holds these records depends on where the domain’s nameservers point. What nameservers are explains how to check that, and why you rarely need to change them.

3. Verify it resolves

check propagation
dig +short example.com
dig +short AAAA example.com
# query a public resolver directly to bypass local cache
dig @1.1.1.1 example.com

If dig shows your IP but the browser does not, your machine cached the old answer. Wait for the TTL to expire or flush the local resolver. If you opened the site in Chrome before the record existed, it may show DNS_PROBE_FINISHED_NXDOMAIN for a while, because resolvers cache “no such name” too. On Windows, nslookup example.com 1.1.1.1 does the job of dig @1.1.1.1. Without a terminal at hand, the DNS lookup tool shows the same A, AAAA and CNAME records, with their TTLs, in the browser.

4. Why it takes a while

DNS changes are not instant. Resolvers worldwide cache the old record until its TTL runs out (usually minutes to a few hours). A record that shows up on dig @1.1.1.1 but not everywhere yet is normal and just needs time. The DNS propagation checker asks twelve public resolvers and your domain’s own name server at once, and shows which of them already return the new address.

5. Add HTTPS once DNS resolves

A certificate can only be issued after the domain points at the server. With that in place, Let’s Encrypt takes one command:

certbot
sudo apt install -y certbot python3-certbot-nginx
sudo certbot --nginx -d example.com -d www.example.com

certbot installs the certificate, edits your nginx config for HTTPS and sets up auto-renewal. From there the site is live on https://.

If the domain is proxied through Cloudflare, set its SSL/TLS mode to Full (strict) now. In Flexible mode Cloudflare fetches every page over plain HTTP, and a server that redirects HTTP to HTTPS sends visitors into ERR_TOO_MANY_REDIRECTS.

Every VMHeaven VPS comes with its own IPv4 address, plus an IPv6 prefix when the location’s pool has one free, so you can point a domain (or many) straight at the box and terminate TLS yourself.

Frequently asked

A record or CNAME?

Use an A record (and AAAA for IPv6) to point the root domain at your server's IP. Use a CNAME to point a subdomain like www at another name, never at an IP.

I changed the record but the site still shows the old server. Why?

DNS is cached until the record's TTL expires. Query a public resolver directly with 'dig @1.1.1.1 example.com' to see the new answer, then wait for caches to clear.

When can I get an HTTPS certificate?

Only after the domain resolves to the server. Then 'sudo certbot --nginx -d example.com' issues and installs a free Let's Encrypt certificate with auto-renewal.

Related articles

All guides

nslookup command: syntax, record types and real output on Windows, Linux and macOS

nslookup NAME asks your DNS server for a name's records; add -type=mx or -type=txt, or a server address. Syntax for Windows, Linux and macOS, with real output.

DNS_PROBE_FINISHED_NXDOMAIN: what Chrome is telling you, and the fix on both sides

DNS_PROBE_FINISHED_NXDOMAIN means your DNS works but this one name did not resolve. Fixes for visitors, and dig checks that find a site owner's missing record.

Temporary failure in name resolution: fix DNS on a Linux server

Your server cannot turn names into IPs. Check the network, /etc/resolv.conf and systemd-resolved, then fix DNS for apt, Docker and sudo on any distro.

Your connection is not private: what each NET::ERR_CERT code means and how to fix it

Your connection is not private means the site's certificate failed a check: expired, untrusted (self-signed) or for another name. Visitor checks and fixes.

How to flush the DNS cache on Windows, macOS and Linux

The exact command for each OS: ipconfig /flushdns on Windows, dscacheutil on macOS, resolvectl flush-caches on Linux, plus clearing Chrome and Firefox's own DNS cache.

Static IP address: what it is, and how to set one on Linux and Windows

A static IP stays the same every time; a dynamic one is handed out fresh. What that means in practice, and how to set a static IP with netplan, nmcli and on Windows.

Check your IP address on Linux: ip addr, hostname -I and your public IP

ip -brief addr show lists every interface's address; hostname -I prints just the addresses. Neither shows your public IP behind NAT; curl ifconfig.me does.

What is web hosting? Hosting types, and domain vs hosting explained

Domain vs hosting: the domain is your site's address, hosting is the server that stores and serves it. Web hosting meaning, types and how DNS links them.