Skip to main content
Once your VPS is running a web server, you can point a custom domain to it so visitors can reach your site by name instead of by IP address. This guide walks you through the DNS setup at your registrar and the corresponding web server configuration on your VPS.

What You Need

Before you start, make sure you have the following:
  • A registered domain name from any registrar (Namecheap, GoDaddy, Cloudflare, Porkbun, etc.)
  • Your VPS IP address, which is visible in the FreeHost dashboard
  • Nginx or Apache installed and running on your VPS (see Install Web Server if you haven’t done this yet)

Step 1 — Find Your VPS IP

Log in to the Opus Host dashboard, click on your VPS, and note the IP address displayed at the top of the overview page. You’ll need to enter this exact value as the DNS record target in the next step.

Step 2 — Add DNS Records at Your Registrar

1

Log in to your registrar

Sign in to the control panel of the company where you registered your domain (e.g., Namecheap, GoDaddy, or Cloudflare).
2

Open DNS management

Navigate to the DNS Management, DNS Settings, or Advanced DNS section for your domain. The exact label varies by registrar.
3

Add an A record for the root domain

Create a new DNS record with the following values:
4

Add an A record for www (optional)

If you want www.yourdomain.com to work as well, add a second A record:
5

Save your changes

Click Save or Confirm. DNS changes don’t take effect instantly — propagation typically takes between 5 minutes and 48 hours, though it’s usually complete within 30 minutes.

Step 3 — Update Your Web Server Config

While DNS propagates, update your Nginx server block so Nginx knows to serve your site for requests to your domain. Open your site’s config file (e.g. /etc/nginx/sites-available/mysite) and update the server_name directive:
Test the configuration for syntax errors and reload Nginx:

Step 4 — Enable HTTPS

Once DNS has propagated and your domain resolves to your VPS IP, you can secure your site with a free TLS certificate. See the Add HTTPS with Let’s Encrypt section in the Install Web Server guide for the full walkthrough.

Check Propagation

You can verify that DNS has propagated using the dig command on your VPS or local machine:
This should return your VPS IP address. If it still shows the old value, wait a few minutes and try again. You can also use a web-based propagation checker like whatsmydns.net to see how your DNS changes look from different locations around the world.
Using Cloudflare as your DNS provider (free tier) is highly recommended — it adds DDoS protection and a global CDN at no cost. Simply add your domain to Cloudflare, update your registrar’s nameservers to Cloudflare’s, and manage DNS records from the Cloudflare dashboard.
Before making DNS changes, set your record’s TTL to a low value like 300 seconds. This reduces how long old DNS responses are cached by resolvers, so your updates propagate much faster.