Tutorial

How to Point a Domain to Your Server: DNS Setup from Registrar to Live Site

March 24, 2026

Back to Blog

You bought a domain name. You rented a VPS. Now what? The gap between "I own a domain" and "my website is live" is bridged by DNS — and for many beginners, this is the most confusing part. Domain registrars, nameservers, A records, propagation — it all feels overwhelming until you understand the simple mechanics behind it.

This guide takes you from a freshly purchased domain to a live website, step by step. We cover configuring DNS at popular registrars, verifying propagation, setting up your web server, and going live with SSL. By the end, your domain will be serving a real website from your server.

The Big Picture

Before we start clicking buttons, here is what needs to happen for your domain to work:

Register
domain.com
Add A Record
pointing to VPS IP
DNS
Propagation
(5min-48hr)
Configure Web
Server (Nginx)
Install SSL
Certificate
Website
is Live!

That is it — five steps. The domain tells DNS where your server is, DNS tells browsers the IP address, and your web server responds with your website. Let us walk through each step in detail.

What You Need Before Starting

You Need

  • A registered domain name (e.g., example.com)
  • A VPS with a public IP address (e.g., 203.0.113.50)
  • SSH access to your server
  • A web server installed (Nginx or Apache)

You Should Know

  • Your server's public IP address
  • Your domain registrar's login credentials
  • Basic SSH and terminal commands
  • What you want to host (WordPress, static site, app, etc.)
Find Your Server's IP Address
If you do not know your server's IP, SSH in and run: curl -s ifconfig.me or hostname -I | awk '{print $1}'

Step 1: Configure DNS at Your Registrar

The exact steps vary by registrar, but the concept is the same everywhere: you need to add an A record that points your domain to your server's IP address.

Method A: Using A Records (Recommended for Most Cases)

This is the simplest and most common approach. You keep your registrar's nameservers and just add A records:

Namecheap

1
Log in to Namecheap Dashboard
2
Click Manage next to your domain
3
Go to Advanced DNS tab
4
Click Add New Record
5
Add two A records:
TypeHostValueTTL
A@203.0.113.50Automatic
Awww203.0.113.50Automatic

GoDaddy

1
Log in to GoDaddy Account
2
Go to My Products > DNS
3
Click Manage DNS for your domain
4
Click Add button
5
Add two A records:
TypeNameValueTTL
A@203.0.113.50600
Awww203.0.113.50600

Method B: Using Cloudflare (Recommended for Performance + Security)

Cloudflare acts as a DNS provider and CDN/firewall combined. To use it, you change your domain's nameservers to Cloudflare's:

1
Create a free Cloudflare account at cloudflare.com and add your domain
2
Add your DNS records in Cloudflare's dashboard:
TypeNameContentProxyTTL
A@203.0.113.50ProxiedAuto
Awww203.0.113.50ProxiedAuto
3
Change nameservers at your registrar to Cloudflare's (they provide two, like ada.ns.cloudflare.com and ben.ns.cloudflare.com)
4
Wait for propagation (usually 1-24 hours for nameserver changes)
Why Cloudflare?
The free tier includes DNS hosting, CDN (caching and speed), DDoS protection, free SSL (Universal SSL), and analytics. There is very little reason not to use Cloudflare for DNS in 2026.

Method C: Changing Nameservers to Your Server

If you run your own DNS server (like BIND), you can point your domain's nameservers to your own server. This gives you full control but requires you to manage DNS infrastructure:

# At your registrar, set custom nameservers:
ns1.example.com → 203.0.113.50
ns2.example.com → 203.0.113.51 (ideally a second server)

# You also need "glue records" at the registrar
# (because ns1.example.com is part of example.com itself)
Single Point of Failure
If your server goes down and you are hosting your own DNS, your domain becomes completely unreachable — not just your website, but email, subdomains, everything. Use at least two nameservers on separate networks for redundancy. For most users, using Cloudflare or your registrar's DNS is simpler and more reliable.

Step 2: Verify DNS Propagation

After adding your DNS records, you need to wait for the changes to propagate across the global DNS network. This can take anywhere from a few minutes to 48 hours, depending on TTL values and resolver caching.

# Method 1: dig command (Linux/macOS)
$ dig example.com A +short
203.0.113.50

$ dig www.example.com A +short
203.0.113.50

# Method 2: Check specific DNS servers
$ dig @1.1.1.1 example.com A +short # Cloudflare
203.0.113.50
$ dig @8.8.8.8 example.com A +short # Google
203.0.113.50
$ dig @9.9.9.9 example.com A +short # Quad9
203.0.113.50

# Method 3: nslookup (works on Windows too)
$ nslookup example.com
Server: 1.1.1.1
Address: 1.1.1.1#53

Non-authoritative answer:
Name: example.com
Address: 203.0.113.50

You can also use online tools to check propagation from multiple locations worldwide:

Online Propagation Checkers

  • whatsmydns.net — checks from 20+ global locations
  • dnschecker.org — visual world map of propagation
  • mxtoolbox.com — DNS lookup + diagnostics
  • toolbox.googleapps.com/apps/dig/ — Google's DNS lookup tool

Expected Propagation Times

Change TypeTypical Time
New A record5 min - 1 hour
Changed A recordBased on old TTL
Nameserver change1 - 48 hours
New TXT record5 min - 1 hour
Quick Propagation Tip
If you are setting up DNS for the first time (no existing records), propagation is usually very fast — often under 5 minutes. The long waits (up to 48 hours) happen when you are changing existing records that had a high TTL value, because the old value is cached at resolvers around the world.

Step 3: Configure Your Web Server

Once DNS is pointing to your server, you need a web server configured to respond to requests for your domain. Without this, visitors will see a default page or an error.

Nginx Server Block

# Create the document root
$ sudo mkdir -p /var/www/example.com/public_html
$ sudo chown -R $USER:$USER /var/www/example.com/

# Create a test page
$ cat > /var/www/example.com/public_html/index.html << 'EOF'
<!DOCTYPE html>
<html>
<head><title>Welcome to example.com!</title></head>
<body>
<h1>It works! example.com is live.</h1>
<p>If you can see this page, DNS and Nginx are configured correctly.</p>
</body>
</html>
EOF
# Create the Nginx server block
$ sudo nano /etc/nginx/sites-available/example.com

server {
listen 80;
listen [::]:80;

server_name example.com www.example.com;
root /var/www/example.com/public_html;
index index.html index.php;

location / {
try_files $uri $uri/ =404;
}

# Security headers
add_header X-Content-Type-Options "nosniff" always;
add_header X-Frame-Options "SAMEORIGIN" always;
add_header X-XSS-Protection "1; mode=block" always;

# Logging
access_log /var/log/nginx/example.com.access.log;
error_log /var/log/nginx/example.com.error.log;
}

# Enable the site
$ sudo ln -s /etc/nginx/sites-available/example.com /etc/nginx/sites-enabled/

# Test configuration
$ sudo nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful

# Reload Nginx
$ sudo nginx -s reload

Apache Virtual Host

# Create the Apache virtual host
$ sudo nano /etc/apache2/sites-available/example.com.conf

<VirtualHost *:80>
ServerName example.com
ServerAlias www.example.com
DocumentRoot /var/www/example.com/public_html

<Directory /var/www/example.com/public_html>
AllowOverride All
Require all granted
</Directory>

ErrorLog ${APACHE_LOG_DIR}/example.com-error.log
CustomLog ${APACHE_LOG_DIR}/example.com-access.log combined
</VirtualHost>

# Enable the site
$ sudo a2ensite example.com.conf
$ sudo apache2ctl configtest
Syntax OK
$ sudo service apache2 reload

Step 4: Test Your Website

Once DNS has propagated and your web server is configured, test from multiple angles:

# Test from command line
$ curl -I http://example.com
HTTP/1.1 200 OK
Server: nginx/1.27.0
Content-Type: text/html
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN

# Test www redirect works
$ curl -I http://www.example.com
HTTP/1.1 200 OK

# Test from the server itself
$ curl -H "Host: example.com" http://localhost
<h1>It works! example.com is live.</h1>
Success!
If you see your test page, everything is working. DNS is pointing to your server, and your web server is responding to requests for your domain.

Step 5: Add SSL (HTTPS)

No modern website should run without SSL. Use Let's Encrypt (free) with Certbot to get an SSL certificate:

# For Nginx
$ sudo certbot --nginx -d example.com -d www.example.com
Successfully received certificate.
Deploying certificate to /etc/nginx/sites-available/example.com
Congratulations! HTTPS is now enabled.

# Verify HTTPS works
$ curl -I https://example.com
HTTP/2 200
strict-transport-security: max-age=31536000

Step 6: Configure www vs non-www Redirect

You should choose one canonical form (either example.com or www.example.com) and redirect the other to it. This prevents duplicate content in search engines:

Redirect www to non-www (most common)

# Nginx: Add this server block
server {
listen 80;
listen 443 ssl;
server_name www.example.com;
ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem;
return 301 https://example.com$request_uri;
}

Redirect non-www to www

# Nginx: Redirect root to www
server {
listen 80;
listen 443 ssl;
server_name example.com;
ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem;
return 301 https://www.example.com$request_uri;
}

Troubleshooting: Domain Not Working?

If your domain is not loading after completing all steps, work through this diagnostic checklist:

ProblemTestSolution
DNS not propagated yetdig example.com +short returns nothingWait longer or check A record at registrar
A record points to wrong IPdig returns different IP than your serverFix A record at registrar
Web server not runningcurl http://YOUR_IP times outStart Nginx/Apache, check logs
Firewall blocking port 80/443sudo ufw status shows blockedsudo ufw allow 80/tcp && sudo ufw allow 443/tcp
Wrong server blockDefault page shows instead of your siteCheck server_name matches your domain
SSL not workingBrowser shows "Not Secure"Run Certbot, check port 443 is open
www works but root doesn'tOnly www.example.com resolvesAdd A record for @ (root domain)
# Complete diagnostic sequence

# 1. Check DNS
$ dig example.com A +short
203.0.113.50 # Should match your server IP

# 2. Check web server is listening
$ sudo ss -tlnp | grep -E ':80|:443'
LISTEN 0 511 0.0.0.0:80 nginx
LISTEN 0 511 0.0.0.0:443 nginx

# 3. Check firewall
$ sudo ufw status | grep -E '80|443'
80/tcp ALLOW Anywhere
443/tcp ALLOW Anywhere

# 4. Check Nginx config
$ sudo nginx -t
nginx: configuration file syntax is ok

# 5. Check error logs
$ sudo tail -20 /var/log/nginx/example.com.error.log

Adding Subdomains Later

Once your main domain is working, adding subdomains follows the same pattern:

# 1. Add an A record at your DNS provider:
blog.example.com A 203.0.113.50

# 2. Create directory and Nginx config
$ sudo mkdir -p /var/www/blog.example.com/public_html

# 3. Create server block (same as main domain, different server_name)
$ sudo nano /etc/nginx/sites-available/blog.example.com
server {
listen 80;
server_name blog.example.com;
root /var/www/blog.example.com/public_html;
...
}

# 4. Enable and get SSL
$ sudo ln -s /etc/nginx/sites-available/blog.example.com /etc/nginx/sites-enabled/
$ sudo nginx -s reload
$ sudo certbot --nginx -d blog.example.com

The Complete Domain Setup Checklist

At Your Registrar

  • Add A record for @ pointing to server IP
  • Add A record for www pointing to server IP
  • (Optional) Change nameservers to Cloudflare
  • Verify records with dig or online tools

On Your Server

  • Create document root directory
  • Create Nginx/Apache configuration
  • Enable the site and reload web server
  • Install SSL with Certbot
  • Set up www/non-www redirect
  • Test from browser and command line

Or Do It All in Seconds with Panelica

Everything described in this guide — DNS configuration, web server setup, directory creation, SSL certificates, logging, error pages — happens automatically in Panelica with a single action: adding a domain.

In Panelica, adding a domain triggers an automatic 9-step provisioning process:

1. Directory
Creation
2. Nginx
Vhost
3. Apache
Vhost
4. PHP-FPM
Pool
5. DNS
Zone
6. SSL
Certificate
7. Log
Rotation
8. Cgroup
Isolation
9. Error
Pages
Domain
Live!
  • Type your domain name in the panel and click Add
  • Panelica creates the directory structure, configures both Nginx and Apache virtual hosts, spins up a dedicated PHP-FPM pool for the user, creates the DNS zone with all required records, issues an SSL certificate via Let's Encrypt, sets up log rotation, configures cgroup resource limits, and generates custom error pages
  • Combined with Cloudflare integration, Panelica can also automatically configure DNS records on Cloudflare, complete with drift detection that alerts you when records change outside the panel
  • The entire process completes in seconds, not the 20-30 minutes of manual configuration described above
From Zero to Live in Seconds
With Panelica, the gap between "I own a domain" and "my website is live" is exactly one click. Every piece of infrastructure described in this guide — DNS, web server, SSL, logging, security — is provisioned automatically as part of the domain creation workflow.
Share: