Servers & VPS

How to Configure Your Domain DNS to Point to a VPS

Learn step by step how to configure your domain's DNS records to point correctly to your VPS server so your website becomes visible on the internet.

Detailed view of Ethernet and VGA ports on a server highlighting connectivity features.

To point a domain to a VPS, you need to create an A record in your domain's DNS zone with your server's public IP address. The change takes anywhere from 15 minutes to 48 hours to propagate worldwide.

This guide walks through every step — from finding your VPS IP to verifying that your DNS records are correct — regardless of which registrar you used to buy the domain.

Basic Concepts Before You Start

Understanding three terms will save you a lot of confusion:

  • DNS zone: the set of records that define where your domain points (web servers, mail, etc.).
  • Nameservers (NS): the servers responsible for answering DNS queries for your domain. These can be your registrar's, your hosting provider's, or a managed DNS service like Cloudflare.
  • A record: links a domain name (e.g., example.com) to an IPv4 address. This is the most important record for pointing to a VPS.

For a deeper look at how DNS and VPS servers work together, check the VPS servers section for complementary guides.

Step 1: Get Your VPS Public IP

Log into your VPS provider's control panel (cPanel, Virtualizor, SolusVM, etc.) or connect via SSH and run:

curl -4 ifconfig.me

Write down that IPv4 address. If your provider also assigned an IPv6 address, note that too for the AAAA record.

Step 2: Decide Who Manages Your DNS Zone

This is the most important decision. You have two paths:

Option A — Manage the DNS Zone at Your Registrar

If you bought the domain from GoDaddy, Namecheap, Name.com, Hostinger, etc., you can edit DNS records directly in their panel without changing nameservers. This is the simplest option if you have a single VPS and don't use a CDN.

Option B — Use Cloudflare or Another Managed DNS

This gives you more control, faster propagation, and extra features (CDN, DDoS protection, flexible SSL). The process is:

  1. Create a Cloudflare account and add your domain.
  2. Cloudflare scans your current DNS zone and imports it.
  3. Cloudflare provides two nameservers (e.g., ada.ns.cloudflare.com).
  4. At your registrar, replace the current nameservers with Cloudflare's.
  5. From that point, manage all DNS records in the Cloudflare dashboard.

For most VPS projects, Option B is the recommended approach.

Step 3: Create the Required DNS Records

Whether you use your registrar or Cloudflare, the records you need are the same. This table summarizes them:

Type Name / Host Value TTL Purpose
A @ (root domain) VPS public IP 300–3600 s Points example.com to the VPS
A www VPS public IP 300–3600 s Points www.example.com to the VPS
AAAA @ VPS IPv6 (if available) 300–3600 s IPv6 support for the root domain
MX @ Mail server IP or hostname 3600 s Email reception (if mail runs on the VPS)

Note about the www record: many registrars use www as the host name. Others ask for the full FQDN (www.example.com). Follow the instructions for your specific panel.

A Record or CNAME for www?

You can create the www subdomain as an A record (direct to the IP) or as a CNAME pointing to @ (an alias for the root domain). Either works. The CNAME is more flexible if you change the IP in the future: just update the root A record and the CNAME follows automatically.

Step 4: Verify DNS Propagation

Once you save the records, verify they've propagated correctly from different points around the world using these free tools:

  • whatsmydns.net — shows results from resolvers in dozens of countries.
  • dnschecker.org — similar, with a visual map.
  • From the terminal: dig example.com A +short

When you see your VPS IP in most locations, the change has propagated. If the site still doesn't load, the issue is no longer DNS — it's your web server configuration (Apache/Nginx) or the firewall.

Common Mistakes and How to Avoid Them

Not Removing Old A Records

If your domain previously pointed to shared hosting, there are likely existing A records with the old IP. Delete them before creating new ones, or you'll end up with conflicts.

Confusing TTL with Propagation Time

TTL is how long resolvers cache the answer. If the previous TTL was 86,400 seconds (24 hours), changes can take up to 24 hours to appear on all resolvers even if you save them immediately. Lower the TTL to 300 seconds a full day before making the switch.

Forgetting to Configure the Virtual Host on the VPS

DNS only routes traffic to the IP address. The web server inside the VPS (Apache or Nginx) must have a Virtual Host configured to respond to the domain. Without it, you'll see the server's default page or a 404 error.

If you need help configuring your web server or are looking for a VPS with included technical support, the team at elenlace.com offers managed servers with assistance during initial setup.

Key Takeaways

  • The A record is the core element: it links your domain to the VPS IP address.
  • Use Cloudflare as your DNS manager for faster propagation and added protection.
  • Create the A record for both the root domain (@) and the www subdomain.
  • Lower the TTL to 300 seconds before switching to speed up propagation.
  • Verify the result with whatsmydns.net or the dig command in your terminal.
  • Remember that DNS only carries traffic to the IP — the Virtual Host on the VPS does the rest.

Ready to get your domain live on a VPS? Contact the specialists at elenlace.com for guidance on the complete server and domain setup.

FAQ

How long does DNS propagation take?

It depends on the TTL the previous records had. With a TTL of 300 seconds, the change can be seen in 5–15 minutes. With a TTL of 86,400 seconds it can take up to 24–48 hours. The typical average when changing from a standard TTL is 1 to 4 hours.

Can I host email on one server and the website on the VPS?

Yes. The A record controls where web traffic goes and the MX record controls email. They are independent. You can point the website to your VPS and keep the MX records pointing to Gmail Workspace, Zoho, or any other external email service.

Should I use Cloudflare with proxy mode on or DNS-only?

Proxy mode (orange cloud in Cloudflare) hides the real VPS IP and enables CDN and DDoS protection. It's recommended for public websites. DNS-only mode (grey cloud) makes Cloudflare resolve the domain without proxying the traffic, which is useful for SSH, FTP, or mail where proxying doesn't apply.

What if I already have nameservers from my previous hosting?

When you change the nameservers at your registrar to Cloudflare's (or your new VPS provider's), the old DNS zone stops having effect. Cloudflare imports existing records when it detects the domain, but always verify that all necessary records (MX, subdomains) are present in the new zone before confirming the nameserver change.

Further reading

Other providers and guides worth comparing:

← All