Description: This guide shows you how to point your domain to your VPS with real examples. Learn how to edit A records, use your VPS IP address, and set up your domain to work with your server—perfect for beginners!
How to Point a Domain to Your VPS: A Step-by-Step Guide with Examples
So, you’ve bought a domain (e.g., exampledomain.com
) and launched a VPS server—now it's time to connect the two. This guide shows you how to point your domain to your VPS using DNS settings, with real-world examples.
🔹 Step 1: Find Your VPS IP Address
Let’s say you're using DigitalOcean or AWS. After creating your VPS (droplet/instance), go to your provider's dashboard.
Example VPS IP Address: 203.0.113.42
Write this down—you’ll need it for your DNS configuration.
🔹 Step 2: Log Into Your Domain Registrar
Assuming you bought your domain from Namecheap, here’s what to do:
- Go to https://namecheap.com and log in.
- Navigate to Domain List > Choose your domain > Click Manage.
- Click on the Advanced DNS tab.
🔹 Step 3: Edit Your DNS Records (A Record)
Scroll to the Host Records section and look for the A record.
Here’s how to set it up:
HostTypeValue (IP)TTL@A203.0.113.42AutomaticwwwA203.0.113.42Automatic
@
points the root domain (exampledomain.com
) to your VPS.
www
ensures that www.exampledomain.com
also works.
💡 In some registrars like GoDaddy or Google Domains, this section is called “DNS Settings” or “DNS Records.”
🔹 Step 4: Wait for DNS Propagation
After saving your changes, it takes time for the DNS changes to take effect across the internet. Usually:
- Average time: 15 minutes to 4 hours
- Worst case: Up to 48 hours
Check if the DNS is working using:
Enter your domain and check if the A record shows 203.0.113.42
.
🔹 Step 5: Set Up Your Web Server
Now make sure your VPS is ready to handle the domain.
Let’s say you use Nginx on Ubuntu.
Example: Nginx Virtual Host for exampledomain.com
bash
sudo nano /etc/nginx/sites-available/exampledomain.com
Paste this config:
nginx
server {
listen 80;
server_name exampledomain.com www.exampledomain.com;
root /var/www/exampledomain.com;
index index.html index.htm;
location / {
try_files $uri $uri/ =404;
}
}
Then enable the site and restart Nginx:
bash
sudo ln -s /etc/nginx/sites-available/exampledomain.com /etc/nginx/sites-enabled/
sudo systemctl restart nginx
Make sure your site directory exists:
bash
sudo mkdir -p /var/www/exampledomain.com
echo "<h1>Hello from VPS!</h1>" | sudo tee /var/www/exampledomain.com/index.html
Now, visit http://exampledomain.com
in your browser. 🎉
🔹 Bonus: Add HTTPS (SSL Certificate)
Install Let’s Encrypt for free HTTPS:
bash
sudo apt install certbot python3-certbot-nginx
sudo certbot --nginx -d exampledomain.com -d www.exampledomain.com
Certbot will automatically configure Nginx and renew certificates.
Common Errors to Watch Out For
ProblemLikely CauseDomain doesn't loadDNS hasn’t propagated yet“Site can’t be reached”Firewall blocking port 80 or 443www doesn’t workForgot the second A record for wwwIP doesn’t point to VPSWrong value in DNS A record
✅ Conclusion
That’s it! You’ve successfully pointed your domain to your VPS. It’s all about setting the correct A records and configuring your server to handle requests.