Introduction:
When you host your website on a Virtual Private Server (VPS), your domain must be configured to direct visitors to that server. This process is known as pointing a domain to a VPS.
Without proper DNS configuration, users will not be able to access your website even if it is fully set up on your server.
There are two common ways to point your domain to a VPS:
1. Using your domain registrar’s DNS (default nameservers)
2. Creating and using custom or private nameservers on your VPS
This guide explains both methods and provides step-by-step instructions to help you configure your domain correctly.
Understanding How Domain Pointing Works
Every domain name uses DNS (Domain Name System) to translate the domain into an IP address. This IP address tells browsers which server hosts the website.
When you point a domain to a VPS, you are essentially telling the DNS system:
“Send all traffic for this domain to this specific VPS IP address.”
This can be done either through DNS records managed by the domain registrar or through DNS hosted on the VPS itself.
Method 1: Point Your Domain Using Registrar Nameservers
When you register a domain, your registrar automatically assigns default nameservers. These nameservers allow you to manage DNS records directly from the domain registrar’s control panel.
If you choose this method, the DNS zone for your domain will remain on the registrar's DNS servers, and you only need to update the required DNS records to point to your VPS.
Steps to Configure DNS Records
1. Log in to your domain registrar account.
2. Open the DNS Management or DNS Zone Editor section.
3. Add or update the following DNS records so they point to your VPS IP address.
Required DNS Records:
|
Host |
Record Type |
Value |
|
www |
A |
Your VPS IP Address |
|
@ (or blank) |
A |
Your VPS IP Address |
|
* |
A |
Your VPS IP Address |
|
|
A |
Your VPS IP Address |
|
MX |
MX |
mail.your-domain-name.com |
These records ensure that:
- Your main domain works
- The www version works
- Subdomains resolve correctly
- Email routing works properly
DNS Propagation Time
After updating the DNS records, it typically takes 24 to 48 hours for the changes to propagate across the internet.
During this time, some users may still see the old configuration until the DNS update is completed globally.
Method 2: Use Custom or Private Nameservers on Your VPS
Another method is to create custom nameservers on your VPS. These are also known as:
- Private nameservers
- Child nameservers
Once configured, these nameservers allow you to manage DNS directly from your VPS instead of relying on your domain registrar’s DNS.
This approach is often used when hosting multiple domains on a VPS.
Example of Custom Nameservers
Suppose your domain is:
yourdomain.com
You can create private nameservers such as:
ns1.yourdomain.com
ns2.yourdomain.com
These nameservers will point to your VPS IP address.
Step 1: Register Private Nameservers at the Domain Registrar
Before using custom nameservers, they must be registered with your domain registrar.
Steps
- Log in to your domain registrar control panel.
- Locate the section called:
- Register Nameservers
- Child Nameservers
- Host Records
- Create the following entries:
ns1.yourdomain.com → Your VPS IP Address
ns2.yourdomain.com → Your VPS IP Address
Because each registrar uses a different interface, the exact steps may vary. If needed, you can contact your registrar’s support team and provide them with your VPS IP address to register the nameservers for you.
Step 2: Host the Domain on Your VPS
After registering your custom nameservers, the next step is to configure your VPS so it can host your domain.
Windows VPS (SolidCP)
If you are using a Windows VPS with SolidCP, you can host and manage domains through the SolidCP control panel.
SolidCP allows you to:
- Add domains
- Manage DNS records
- Configure hosting settings
Refer to SolidCP documentation for detailed instructions.
Linux VPS (cPanel / WHM)
If you are using a Linux VPS with cPanel, you can host your domain in two ways:
- Create a new hosting account in WHM
• Add the domain as an Addon Domain in an existing cPanel account
Once the domain is added, the server will begin managing the DNS zone for that domain.
Step 3: Configure DNS on the VPS
Once the domain is hosted, DNS records must be managed through the server control panel.
Windows VPS (SolidCP)
Use the DNS management section within SolidCP to configure DNS records.
Linux VPS (cPanel)
Use the DNS Zone Editor in cPanel to create or modify DNS entries for your domain.
Step 4: Assign the Custom Nameservers to the Domain
Once your private nameservers are configured, you must assign them to your domain.
Steps
- Log in to your domain registrar account.
- Go to the Nameserver settings.
- Replace the existing nameservers with your custom nameservers.
Example:
ns1.yourdomain.com
ns2.yourdomain.com
After saving the changes, your domain will begin using your VPS for DNS resolution.
Verify That Your Domain Points to Your VPS
After completing the configuration, DNS propagation may take 24 to 48 hours.
You can verify whether your domain is pointing correctly by using DNS lookup tools such as:
MyDNS.Is
These tools show how your domain resolves from different global DNS locations.
Advantages of Using Custom Nameservers
Using private nameservers on your VPS provides several benefits:
- Centralized DNS management for all hosted domains
- Greater flexibility when hosting multiple websites
- Full control over DNS configuration
- Professional branding with custom nameservers
Conclusion:
Pointing a domain to a VPS is a necessary step to make your website accessible online. This can be done either by updating DNS records through your domain registrar or by creating custom nameservers on your VPS.
Using registrar DNS is usually the simplest method for basic setups, while private nameservers offer greater control and scalability when managing multiple domains on a VPS.
Once the configuration is complete, DNS changes typically propagate within 24 to 48 hours, after which your website will begin resolving to your VPS server.
