If you have a domain hosted with one provider but your application or website is running on a VPS from another provider, you don't need to move the entire domain.
You can simply create a subdomain and point it to your VPS.
For example, suppose your main domain is:
mydomain.com
And you have a Contabo VPS where you want to host an application at:
mysubdomain.mydomain.com
In this setup:
- Your main domain remains with your existing DNS provider, such as Truehost.
- Your application runs on the Contabo VPS.
- The subdomain points directly to the VPS IP address.
- Your DNS provider tells browsers where to find that subdomain.
This guide walks through the process step by step.
What You Need Before Starting
You will need:
- A registered domain, for example
mydomain.com - Access to the domain's DNS management panel
- A Contabo VPS
- The public IPv4 address of your VPS
- Access to the server so you can configure your web server
In this example, we'll use:
Domain: mydomain.com
Subdomain: mysubdomain.mydomain.com
VPS Provider: Contabo
DNS Provider: Truehost
How DNS Works in This Setup
Before changing anything, it helps to understand what is actually happening.
When someone enters:
https://mysubdomain.mydomain.com
their browser needs to know which server should receive the request.
The DNS record provides that information.
You will essentially tell DNS:
mysubdomain.mydomain.com
↓
Contabo VPS IP address
↓
Your application
This is done using an A record.
An A record maps a domain or subdomain to an IPv4 address.
For more background, see cPanel's explanation of pointing a subdomain to another server.
Step 1: Find Your Contabo VPS IP Address
First, you need to find the public IP address of your Contabo VPS.
Log in to your Contabo Customer Control Panel and open your VPS details.
You should see an IPv4 address similar to:
123.123.123.123
Copy this IP address.
You will need it when creating the DNS record.
Why do you need the IP address?
DNS needs to know where to send requests for your subdomain.
For example:
mysubdomain.mydomain.com
↓
123.123.123.123
The IP address is therefore the destination for your subdomain.
Step 2: Open Your DNS Zone Editor
If your domain is managed through Truehost, log in to your Truehost cPanel.
From the cPanel dashboard, look for the Domains section.
Select:
Zone Editor
The Zone Editor allows you to manage DNS records for your domain.
You can also refer to Truehost's guide on subdomains and domain configuration.
You should see your domain listed, for example:
mydomain.com
Select the option to manage its DNS records.
Step 3: Create an A Record
This is the most important step.
An A record tells DNS:
When someone requests this hostname, send them to this IPv4 address.
Next to mydomain.com, select:
+ A Record
You will typically see fields similar to:
Name:
Address / Value:
Enter your values.
Name
You can enter:
mysubdomain
Depending on your DNS provider, you may also be able to enter the complete hostname:
mysubdomain.mydomain.com
Address / Value
Enter the IPv4 address of your Contabo VPS.
For example:
123.123.123.123
Your record will effectively look like:
Type: A
Name: mysubdomain
Value: 123.123.123.123
Then save the record.
For additional background on creating A records, see HostPapa's guide to pointing a subdomain to an IP address.
Step 4: Configure Your Contabo VPS
Adding the DNS record is only half of the process.
Your VPS also needs to know what to do when a request arrives for:
mysubdomain.mydomain.com
For example, if you're using Nginx, you need to configure a server block for the subdomain.
A simplified configuration could look like:
server {
listen 80;
server_name mysubdomain.mydomain.com;
root /var/www/mysubdomain;
index index.html;
}
If you're using Apache, CyberPanel, or another server management solution, the configuration will be different.
The important thing is that your VPS must be configured to recognize the hostname.
Think of it this way:
DNS
|
| mysubdomain.mydomain.com
↓
Contabo VPS
|
| "I know this domain"
↓
Web server
|
↓
Your application
If DNS is configured correctly but your web server doesn't recognize the domain, the request can still fail.
Step 5: Test the DNS Configuration
After saving the A record, you can check whether the DNS record is resolving correctly.
From your computer, you can use:
nslookup mysubdomain.mydomain.com
Or:
dig mysubdomain.mydomain.com
You should eventually see your Contabo VPS IP address returned.
For example:
mysubdomain.mydomain.com
Address: 123.123.123.123
You can also use online DNS lookup tools to check whether the record has propagated.
Step 6: Configure HTTPS
Once the subdomain is pointing correctly to your VPS, you will probably want to enable HTTPS.
Instead of accessing:
http://mysubdomain.mydomain.com
you want:
https://mysubdomain.mydomain.com
If you're using Nginx, one popular option is Certbot with Let's Encrypt.
Let's Encrypt provides free TLS certificates for HTTPS.
You can learn more from the official Let's Encrypt documentation.
How Long Does DNS Propagation Take?
DNS changes are not always visible immediately.
After creating the A record, it can take some time before different DNS resolvers around the internet start returning the new IP address.
You may see the subdomain working within a few minutes, while in some cases you may need to wait longer.
This is commonly referred to as DNS propagation.
So don't worry if:
Your computer → old DNS information
while another device or DNS checker already sees:
mysubdomain.mydomain.com → Contabo VPS
DNS caching can cause temporary differences.
Common Mistakes to Check
If your subdomain isn't working, check these things first.
1. Wrong IP address
Make sure the A record points to the public IPv4 address of your Contabo VPS.
2. Incorrect DNS record
Make sure you created an A record, not a CNAME record, if you're directly pointing the hostname to an IPv4 address.
3. Web server isn't configured
DNS can successfully point the domain to your VPS, but Nginx, Apache, or your control panel still needs to know how to handle the hostname.
4. Firewall
Make sure your VPS firewall allows HTTP and HTTPS traffic.
Typically:
Port 80 - HTTP
Port 443 - HTTPS
5. DNS hasn't propagated yet
Give the DNS change some time and check it using nslookup, dig, or an online DNS checker.
The Final Setup
Once everything is configured, the architecture will look something like this:
Internet
|
|
mysubdomain.mydomain.com
|
↓
DNS A Record
|
↓
Contabo VPS IP
123.123.123.123
|
↓
Nginx / Apache
|
↓
Your Application
Your main domain can continue operating normally:
mydomain.com
while your subdomain runs from the Contabo VPS:
mysubdomain.mydomain.com
You don't need to move the entire domain to Contabo just to host one application on your VPS.
Conclusion
Pointing a subdomain to a Contabo VPS is relatively straightforward once you understand the separation between DNS and your server.
The basic process is:
- Find your Contabo VPS IP address.
- Open your domain's DNS Zone Editor.
- Create an A record for your subdomain.
- Point the A record to the VPS IP address.
- Configure Nginx, Apache, or your server software to handle the subdomain.
- Wait for DNS changes to propagate.
- Configure HTTPS once the domain resolves correctly.
The key thing to remember is that DNS only tells the internet where your server is. Your VPS still needs to be configured to serve the application for that specific hostname.
Once you understand this pattern, you can use it to host multiple applications on the same VPS, for example:
api.mydomain.com
app.mydomain.com
admin.mydomain.com
blog.mydomain.com
All of them can point to the same VPS while your web server routes each hostname to the appropriate application.
Top comments (0)