Domain Configuration Guide for Developers
Md. Aminul Islam•
Post Date:02 Jan 2026 - 06:23 AM
Domain configuration is a fundamental skill for every web developer. Whether you're deploying a personal portfolio, SaaS application, or backend API on a VPS, understanding DNS records helps connect your domain name to your server correctly.
In this guide, I’ll explain DNS records, their purpose, and how to configure domains and subdomains for a VPS-hosted application.
📚 What is DNS?
DNS (Domain Name System) is like the internet’s phonebook.
It translates human-readable domain names:
into machine-readable IP addresses:
Without DNS, users would need to remember IP addresses instead of domain names.
🔹 A Record (Address Record)
Purpose
An A record connects a domain directly to an IPv4 address.
When a user visits your domain, DNS uses the A record to find your server’s IP.
Example
Field | Value | Description |
|---|---|---|
Type | A | Address Record |
Host | @ | Root domain (example.com) |
Value | 192.0.2.1 | Server IP |
TTL | 3600 | Cache time |
How it works
Use Case
- Connecting your domain to VPS
- Hosting website on custom server
- Backend API hosting
CNAME Record (Canonical Name Record)
Purpose
A CNAME record aliases one domain to another domain.
It does not point to an IP directly.
Example
Field | Value |
|---|---|
Type | CNAME |
Host | www |
Value | example.com |
TTL | 3600 |
How it works
Use Case
- Point subdomains to main domain
- Connect domain to external services (Vercel, Netlify, etc.)
🔹 TXT Record (Text Record)
Purpose
TXT records store text information in DNS.
Used for:
- Domain verification
- Email authentication
- Security configuration
Example (SPF Record)
Field | Value |
|---|---|
Type | TXT |
Host | @ |
Value | "v=spf1 include:_spf.google.com ~all" |
TTL | 3600 |
Use Case
- Google Search Console verification
- Email setup (Gmail, Outlook)
- Prevent email spoofing
🔹 NS Record (Name Server)
Purpose
NS records tell the internet which DNS server manages your domain.
Example
These servers contain your DNS records.
🔹 What is TTL in DNS?
TTL (Time To Live) defines how long DNS records are cached.
Example:
Means DNS will cache for:
Common TTL Values
TTL | Duration | Use Case |
|---|---|---|
60 | 1 minute | Testing |
300 | 5 minutes | CDN |
3600 | 1 hour | Default |
86400 | 1 day | Stable websites |
⚖️ A Record vs CNAME Record
Feature | A Record | CNAME |
|---|---|---|
Points to | IP address | Domain |
Speed | Faster | Slightly slower |
Root domain support | Yes | No |
Flexibility | Less flexible | More flexible |
VPS Domain Configuration Example
Suppose you purchased a VPS and want to host multiple websites.
Setup
Domain:
VPS IP:
Subdomains:
Option 1: Using A Records
Type | Host | Value | TTL |
|---|---|---|---|
A | @ | 79.87.90.90 | 3600 |
A | www | 79.87.90.90 | 3600 |
A | portal | 79.87.90.90 | 3600 |
A | server | 79.87.90.90 | 3600 |
Option 2: Using CNAME (Recommended)
Type | Host | Value | TTL |
|---|---|---|---|
A | @ | 79.87.90.90 | 3600 |
CNAME | www | aminul.com | 3600 |
CNAME | portal | aminul.com | 3600 |
CNAME | server | aminul.com | 3600 |
This setup is easier to maintain.
Only update one A record if server IP changes.


