How to Point a Domain to a VPS

A guide on how to configure DNS records at your domain registrar to direct traffic │ from your domain name to your Virtual Private Server (VPS).

Beginner

To point a domain to a Virtual Private Server (VPS), you generally need to perform the following steps:

1. Obtain Your VPS IP Address

  • Log in to your VPS control panel or SSH into your VPS.
  • Note down the public IPv4 address (and IPv6 address if available and desired).

2. Access Your Domain Registrar's DNS Management

  • Log in to the website where you registered your domain name (e.g., GoDaddy, Namecheap, Cloudflare, etc.).
  • Navigate to the DNS management section for your specific domain. This section might be called "DNS Settings," "Manage DNS," "Zone Editor," or similar.

3. Create or Modify DNS Records

  • You will typically need to create or modify "A" records (for IPv4) and potentially "AAAA" records (for IPv6).
  • For the main domain (e.g., yourdomain.com):
    • Create an A record with the Host/Name field set to @ (or sometimes left blank, depending on the registrar).
    • Set the Value/Points To field to your VPS's IPv4 address.
    • Set the TTL (Time To Live) to a reasonable value (e.g., 3600 seconds or 1 hour).
  • For the www subdomain (e.g., www.yourdomain.com):
    • You can either create another A record with the Host/Name set to www and the Value/Points To set to your VPS's IPv4 address.
    • Alternatively, you can create a CNAME record with the Host/Name set to www and the Value/Points To set to yourdomain.com (this points www to whatever yourdomain.com points to).
  • If you have an IPv6 address for your VPS:
    • Create an AAAA record for the main domain (@) and/or www subdomain, pointing to your VPS's IPv6 address.

4. Save Changes

  • After adding or modifying the records, save your changes.

5. Wait for DNS Propagation

  • DNS changes are not instant. It can take anywhere from a few minutes to 48 hours for the changes to propagate across the internet's DNS servers. This period is known as DNS propagation.
  • You can check the propagation status using online tools like whatsmydns.net.

6. Configure Your VPS (Web Server)

  • Ensure your web server (e.g., Apache, Nginx) on your VPS is configured to listen for requests for yourdomain.com and www.yourdomain.com. This usually involves setting up virtual hosts or server blocks.

Once propagation is complete and your web server is correctly configured, your domain name will point to your VPS, and visitors accessing your domain will see the content hosted on your server.