Point a subdomain to another VPS server with Cpanel

Operating System & Version
CENTOS 7.9
cPanel & WHM Version
v90.0.16 Load Averages: 0.01 0.02 0.05

kiaraumi

Registered
Nov 13, 2020
1
0
1
Mexico
cPanel Access Level
Root Administrator
Hi guys, I have the following case: I have two VPS servers in order to have a development server and a productive one, the first one has the IP 10.10.10.10 and the second one the 20.20.2.20 both have Cpanel WHM installed

The 10.10.10.10 server, which is development, was installed with the registry and host as follows: dev.domain.com

The 20.20.20.20 server that is productive was installed with the registry and host domain.com

Today the domain.com is pointing to the server 20.20.20.20 and it responds correctly, however, in the DNS Zones editor create the subdomain dev.dominio.com and it will point to the other server that is 10.10.10.10 leaving the A record of the Following way

dev.domain.com A 14400 10.10.10.10 however I cannot reach the development server from that URL

Do you have any idea where my mistake is?

Thank you!
 

keat63

Well-Known Member
Nov 20, 2014
1,961
267
113
cPanel Access Level
Root Administrator
Not sure if this is of any use to you, but when we had a development site being created by a 3rd party, they asked me to create a DNS record.
In the main DNS table for the domain, I added a new entry:

dev A IP Address of the dev server
 

Attachments

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
14,307
2,239
363
cPanel Access Level
Root Administrator
As long as the DNS records point the subdomain to the correct IP address, I would expect things to work. You'll just want to ensure the subdomain's DNS is setup at the correct system, whichever one manages the DNS for the domain.
 

efcjunior

Registered
Nov 15, 2020
1
0
0
Brazil
cPanel Access Level
Website Owner
Hi guys, I have the following case: I have two VPS servers in order to have a development server and a productive one, the first one has the IP 10.10.10.10 and the second one the 20.20.2.20 both have Cpanel WHM installed

The 10.10.10.10 server, which is development, was installed with the registry and host as follows: dev.domain.com

The 20.20.20.20 server that is productive was installed with the registry and host domain.com

Today the domain.com is pointing to the server 20.20.20.20 and it responds correctly, however, in the DNS Zones editor create the subdomain dev.dominio.com and it will point to the other server that is 10.10.10.10 leaving the A record of the Following way

dev.domain.com A 14400 10.10.10.10 however I cannot reach the development server from that URL

Do you have any idea where my mistake is?

Thank you!
Hi,

I fixed my similar problem running this command in my server: /sbin/iptables -t nat -I PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 8080 --> change for the port that your application is running on.