Mist Network

How to Point a Domain to a VPS: A Records, www and SSL

Point your domain at your server in a few minutes: which DNS records to create, example values, how to test them and how to configure the VPS once traffic arrives.

Updated: 5 min read
How to point a domain to a VPS using A and AAAA DNS records

To point a domain to a VPS, create an A record for the root domain (@) that contains your server's IPv4 address, add an AAAA record if the VPS has IPv6, and point www to the same server with a CNAME or a second A record. Once DNS updates, configure the web server on the VPS to answer for that domain.

That is the whole idea. The rest of this guide shows exactly which records to create, how to verify them from your terminal, and what to do on the server so visitors see your site instead of an error page.

What you need before you start

  • A registered domain and access to the place where its DNS is managed. For domains registered at mistREG, that is the DNS section of the mistREG panel.
  • A VPS with a public IP address. On a mistREG KVM VPS, the IP and root password appear in your panel within about 60 seconds of payment.
  • SSH access to the server so you can install and configure a web server.
  • Ten minutes. The records take seconds to add; the waiting is DNS caches catching up.

Do not have a server yet? You can create an account, top up and order a KVM VPS in Slovenia (EU) with NVMe SSD and AMD EPYC hardware from the plans section.

A records or nameservers: two ways to connect a domain

There are two ways to connect a domain to a VPS, and mixing them up is the most common source of confusion.

MethodWhat you changeBest for
DNS records (A / AAAA / CNAME)Records in your existing DNS zoneMost people; keeps email and other records in one place
Custom nameserversThe NS delegation of the whole domainRunning your own DNS server or a separate DNS provider

For a single website on a single VPS, use records. At mistREG your zone is already hosted on Cloudflare's authoritative DNS network, so you only add an A record and you are done. Switching to custom nameservers moves the domain out of that zone, and every record then has to be recreated at the new DNS host.

Key takeaway: You do not need to change nameservers to point a domain to a VPS. One A record for @ and one record for www is enough.

Step by step: point your domain to a VPS

  1. Copy the server IP — Open your VPS in the panel and copy its IPv4 address (and IPv6 if one is assigned).
  2. Open the DNS zone — In the mistREG panel, go to your domain and open DNS management.
  3. Remove conflicting records — Delete any old A, AAAA or CNAME records for @ and www that point to parking pages or a previous host. Leave MX and TXT records alone.
  4. Add the A record — Type A, name @, value your IPv4 address. Choose a short TTL such as 300 seconds while you test.
  5. Add the www record — Either a CNAME from www to your root domain, or a second A record for www with the same IP.
  6. Add AAAA if you have IPv6 — Only if the server is actually listening on IPv6. A broken AAAA record is worse than none.
  7. Verify and configure the server — Check the records with dig, then set up the web server and HTTPS as described below.

Example DNS records

Here is what a typical zone looks like for a site on one VPS. The IP addresses are documentation examples; replace them with your own.

TypeNameValueTTL
A@203.0.113.10300
AAAA@2001:db8::10300
CNAMEwwwexample.com300
CAA@0 issue letsencrypt.org3600

The CAA record is optional. It tells certificate authorities which of them may issue certificates for your domain. The mistREG panel supports 20 record types, including all of the above; our guide to DNS record types explains what each one does.

TTL tip: Keep TTL low (60 to 300 seconds) while setting up or migrating. Once everything works, raise it to an hour or more, or select auto. mistREG lets you choose anywhere from 60 to 86400 seconds.

How to check that the domain points to your VPS

Do not rely on your browser, which caches aggressively. Ask DNS directly from a terminal:

dig +short example.com A
dig +short www.example.com
dig +short example.com AAAA
nslookup example.com 1.1.1.1

If dig returns your server IP, the record is live. If it returns an old IP, resolvers are still serving a cached answer; that clears once the old TTL expires. How long this takes, and why different networks see changes at different times, is covered in our article on DNS propagation time.

Records created at mistREG are DNS only, which means dig shows your real server IP rather than a proxy address. That makes debugging straightforward: what you see is where the traffic goes.

Configure the VPS to answer for the domain

DNS only delivers visitors to the right machine. The server still has to know which site to serve. On a fresh Linux VPS the usual steps are:

  1. Install a web server such as Nginx, Apache or Caddy.
  2. Create a site configuration with your domain and www as server names. In Nginx that is the server_name line; in Apache, ServerName and ServerAlias.
  3. Open the firewall for ports 80 and 443.
  4. Issue an SSL certificate once DNS resolves to the VPS. Tools like Certbot validate over port 80, so the A record must already point to the server.
  5. Redirect HTTP to HTTPS and pick one canonical host, either www or the bare domain.

A quick way to test the server before DNS has fully updated is to request the site by IP with the right host header, for example curl -I -H Host:example.com http://203.0.113.10. If that returns your site's headers, the server side is ready and anything left is DNS caching.

Moving an existing site? Copy files and the database to the new VPS first, test it with the method above, and only then change the A record. Visitors keep hitting the old server until the switch, so there is no downtime window.

If you prefer a control panel over the command line, mistREG Plesk hosting with LiteSpeed Web Server handles virtual hosts and certificates for you, and it is also set up in about 60 seconds.

Do not break email and other records

Pointing a domain to a VPS changes where the website lives, not where email is delivered. Keep these in mind:

  • MX records stay pointing at your email provider unless you are running a mail server on the VPS.
  • SPF, DKIM and DMARC are TXT records. Do not delete them while cleaning up old A records.
  • Subdomains like api or app each need their own A or CNAME record if they should reach the VPS.
  • Reverse DNS (PTR) for the server IP matters if the VPS sends email; it is configured for the IP, not in the domain's zone.

Troubleshooting: domain not pointing to the server

SymptomLikely causeFix
dig shows the old IPCached record, high old TTLWait for the old TTL to expire
Bare domain works, www does notMissing www recordAdd CNAME or A for www
Correct IP, but connection refusedWeb server stopped or firewall closedStart the service, open ports 80/443
Default welcome page appearsNo site config for the domainAdd server_name / ServerName
Records ignored completelyDomain uses custom nameserversEdit records at the active DNS host

Still stuck? Message support on Telegram at @mistnetwork or open a ticket from the panel; the team is available 24/7. Background on how resolution works is on Wikipedia's DNS article, and answers to account questions are in the FAQ.

Frequently asked questions

How do I point my domain to my VPS IP address?
Create an A record with the name @ and your VPS IPv4 address as the value, then add a CNAME or A record for www. Add an AAAA record too if the server uses IPv6.
Should I use an A record or change nameservers?
For one website on one VPS, use an A record. Change nameservers only if you want a different DNS provider to manage the whole zone, because all records must then be recreated there.
How long does it take for a domain to point to a new VPS?
New records are usually visible within minutes. If an older record was cached with a long TTL, some networks may keep showing the old IP until that TTL expires.
Do I need a CNAME for www?
You need some record for www. A CNAME pointing to the root domain is easiest because it follows the root A record automatically; a second A record with the same IP works too.
Why does my domain show the wrong website after pointing it to the VPS?
DNS is working but the web server has no site configuration for your domain, so it serves its default site. Add a virtual host with your domain as server name and reload the web server.

Related articles

Mist NetworkMist Network