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:
domain.com
pointing to VPS IP
Propagation
(5min-48hr)
Server (Nginx)
Certificate
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.)
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
| Type | Host | Value | TTL |
|---|---|---|---|
| A | @ | 203.0.113.50 | Automatic |
| A | www | 203.0.113.50 | Automatic |
GoDaddy
| Type | Name | Value | TTL |
|---|---|---|---|
| A | @ | 203.0.113.50 | 600 |
| A | www | 203.0.113.50 | 600 |
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:
| Type | Name | Content | Proxy | TTL |
|---|---|---|---|---|
| A | @ | 203.0.113.50 | Proxied | Auto |
| A | www | 203.0.113.50 | Proxied | Auto |
ada.ns.cloudflare.com and ben.ns.cloudflare.com)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:
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)
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.
$ 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 Type | Typical Time |
|---|---|
| New A record | 5 min - 1 hour |
| Changed A record | Based on old TTL |
| Nameserver change | 1 - 48 hours |
| New TXT record | 5 min - 1 hour |
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
$ 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
$ 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
$ 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:
$ 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>
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:
$ 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)
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
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:
| Problem | Test | Solution |
|---|---|---|
| DNS not propagated yet | dig example.com +short returns nothing | Wait longer or check A record at registrar |
| A record points to wrong IP | dig returns different IP than your server | Fix A record at registrar |
| Web server not running | curl http://YOUR_IP times out | Start Nginx/Apache, check logs |
| Firewall blocking port 80/443 | sudo ufw status shows blocked | sudo ufw allow 80/tcp && sudo ufw allow 443/tcp |
| Wrong server block | Default page shows instead of your site | Check server_name matches your domain |
| SSL not working | Browser shows "Not Secure" | Run Certbot, check port 443 is open |
| www works but root doesn't | Only www.example.com resolves | Add A record for @ (root domain) |
# 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:
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
wwwpointing to server IP - (Optional) Change nameservers to Cloudflare
- Verify records with
digor 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:
Creation
Vhost
Vhost
Pool
Zone
Certificate
Rotation
Isolation
Pages
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
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.