How to point subdomain to another server?

Joined
Oct 23, 2013
Messages
26
Best answers
0
Ratings
1
Points
0
#1
I'm using WHM/cPanel and I had my domain name hosted on an IP, just wondering how can I setup a sub domain to point to a different server independently without a redirection?
 

LJSHost

Well-known member
Joined
Jul 5, 2016
Messages
1,031
Best answers
0
Ratings
202
Points
63
#2
You should just be able to change the DNS for that subdomain in the DNS zone for the domain. Just point those records at the other server.
 
Joined
Jan 12, 2017
Messages
58
Best answers
1
Ratings
21
Points
0
#3
Hi elzorro,

You can login to your DNS management for your domain and add an a record for your sub-domain. The below is a sample record in from my DNS zone. ftp1 would be your sub-domain name. The 0.0.0.0 should be replace with the ip of your other server.

ftp1 A - IPv4 Address 0.0.0.0
 
Joined
Oct 23, 2013
Messages
26
Best answers
0
Ratings
1
Points
0
#4
You should just be able to change the DNS for that subdomain in the DNS zone for the domain. Just point those records at the other server.
Would you mind giving me a real example? I will use A record for this?


Hi elzorro,

You can login to your DNS management for your domain and add an a record for your sub-domain. The below is a sample record in from my DNS zone. ftp1 would be your sub-domain name. The 0.0.0.0 should be replace with the ip of your other server.

ftp1 A - IPv4 Address 0.0.0.0
Can you share me an image how to setup this? I am new to WHM/cPanel.

One question more, Instead of pointing for a sub domain, I can point for a sub folder

For example

example.com/myblog/

/myblog/ will be hosted on other hosting servers.

I have not ever done this in the past.
 
Joined
Jan 12, 2017
Messages
58
Best answers
1
Ratings
21
Points
0
#5
kevinhng86
I do not think you can point a folder to another hosting provider. I don't think DNS record allow you to point a folder to an ip, DNS only allow you to point the URL itself but not the fragment of it which is the folder structure. However I think you can point the sub-domain to a difference server and then use mod-rewrite or redirect your folder to your sub-domain.

For Cpanel edit of DNS record check out this link https://documentation.cpanel.net/display/ALD/Edit+DNS+Zone.

In Cpanel click on simple DNS zone editor. You will get that screen in the image. In the name box of add an A record put in the sub-domain name. In the address box of add an A record is the I.Pv4.0 address of the hosting server. After fill in that two box you can click add an A record.

Screenshot from 2017-01-12 01:21:23.jpg

For redirection you need to use .htaccess file with rewrite engine. You can add the below to the .htaccess file on your web-root directory.
Code:
Options +FollowSymLinks
RewriteEngine On
Redirect 301 /myblog http://myblog.yourdomain.com/
 
Joined
Oct 23, 2013
Messages
26
Best answers
0
Ratings
1
Points
0
#7
I do not think you can point a folder to another hosting provider. I don't think DNS record allow you to point a folder to an ip, DNS only allow you to point the URL itself but not the fragment of it which is the folder structure. However I think you can point the sub-domain to a difference server and then use mod-rewrite or redirect your folder to your sub-domain.

For Cpanel edit of DNS record check out this link https://documentation.cpanel.net/display/ALD/Edit+DNS+Zone.

In Cpanel click on simple DNS zone editor. You will get that screen in the image. In the name box of add an A record put in the sub-domain name. In the address box of add an A record is the I.Pv4.0 address of the hosting server. After fill in that two box you can click add an A record.

View attachment 1947

For redirection you need to use .htaccess file with rewrite engine. You can add the below to the .htaccess file on your web-root directory.
Code:
Options +FollowSymLinks
RewriteEngine On
Redirect 301 /myblog http://myblog.yourdomain.com/
I don't think it is simple like that. Thanks for guiding me.
This should add in cPanel of a domain, not in WHM, right?

If you upload a screen shot of the zone file for this domain I can show you what needs changing.
Is this the zone file? here is mine

dns-zone-file.png
 
Joined
Jan 12, 2017
Messages
58
Best answers
1
Ratings
21
Points
0
#9
kevinhng86
With that panel style, under the add new entries, the first white box just put in your subdomain name. The select box should have an record mention something in regard to A, Cname, etc. Choose A. After that it will probably produce a white box somewhere. Type the I.P in that white box. For Ipv4 server use the A name record. For Ipv6 server use AAAA record.
 

LJSHost

Well-known member
Joined
Jul 5, 2016
Messages
1,031
Best answers
0
Ratings
202
Points
63
#8
That does not seem to be the correct zone file.
It needs to be the zone file from the domain that has the sub domain you want to point somewhere else.

WHM creates addon domains as a redirected subdomain for the domain but sub domains are still sub domains.

for example subdomain.domain.com you would need the zone file for domain.com
 

racksandcloud

Well-known member
Joined
May 18, 2017
Messages
89
Best answers
0
Ratings
13
Points
0
#10
You should edit the DNS record of the domain and update the IP address of another server as the A record of sub domain.


Sub-domain A 192.168.1.1(IPV4 address of other server)
 

Dewlance

Well-known member
Joined
Dec 20, 2014
Messages
102
Best answers
0
Ratings
19 1
Points
18
#11
I was did this few month ago for monitoring my site.

What I did?
I was created a hosting account in my other cPanel server using full domain name like "subdomain.example.com" and then in my main server I only add a A record and point my A record to other server.

Example DNS record
subdomain A - IP Here.

On my other server, I was pointed my subdomain nameserver to main server.
 

macklong

Active member
Joined
Jun 17, 2016
Messages
67
Best answers
0
Ratings
4
Points
0
#12
What I use is Domain DNS or CloudFlare DNS system.

Any subdomain I create "A" list and trigger to that IP.

Done, SIMPLE>

Thanks
 
Newer Threads
Replies
7
Views
1,302
Replies
4
Views
785
Replies
32
Views
2,929
Latest Threads
  • Awaiting approval
Replies
0
Views
1
Ebb
Replies
0
Views
1
Replies
0
Views
3

Latest Hosting OffersNew Reviews

Sponsors

Latest Blog ArticlesMost Viewed Threads

Tag Cloud

You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an alternative browser.

Top