Host a website for a domain hosted somewhere else?

atodea

Member
Apr 23, 2011
16
0
51
Is it possible to host a website for a domain hosted somewhere else?

Server A: New server with cPanel that shoud host the website without adding the domain.
Server B: A different server which already hosts the domain (DNS, Email, etc.)

I want to move just the website from Server B to Server A leaving the other services on Server B.
I know that on Server B I have to redirect www to the IP of Server A.
I want to learn what am I supposed to do on Server A and if it's possible to that from Server A's cPanel.

Thank you!
 

JayFromEpic

Well-Known Member
Apr 2, 2011
218
8
68
Scottsdale
cPanel Access Level
Root Administrator
Twitter
What your looking at doing is basically off server email hosting. It is actually fairly easy. Depending on your domain registrar, it is usually a 5 minute setup.

What you need to do is just set your name servers like they normally are, ns* and ns*. But when you go and make the website account, you will see option at the bottom for mail configuration, your gonna wanna choose the one that suites you and you will then need to change the mx records. Thats about it.
 

atodea

Member
Apr 23, 2011
16
0
51
Thanks but this is not what I meant.
I want to host the website on a new cPanel server while leaving DNS, MX on a different server.
I just want to move the website on my new cPanel without affecting anything else that is already working on the other server.
I know what I have to do on the other server (Server B).
What I want to know is how can I setup my website on cPanel without adding DNS records for that domain.
 

BMR777

Member
Nov 26, 2008
15
0
51
I suppose that on server b you could edit the DNS so that the A record for the domain points to server a's primary IP. Then on server a, create a new account with the domain name of the site you want to host, and change the DNS for everything except the A record back to the other server.

Not sure if it will work, but I always wondered if something like this would work. You still have to add the domain to server a, however you're still having the DNS for the domain set to server b. :)
 

atodea

Member
Apr 23, 2011
16
0
51
Thanks, this is almost perfect.
Sometines however I don't know the Settings on Server B
A client may want to host his (only the) website with me but I'm not in control of his DNS to know it's settings.
Isn't there any way to host a website on cPanel without adding DNS settings?
 

BMR777

Member
Nov 26, 2008
15
0
51
As long as the client sets their domain's nameservers to those of Server B this scenario will work fine.
 

cPanelTristan

Quality Assurance Analyst
Staff member
Oct 2, 2010
7,607
38
248
somewhere over the rainbow
cPanel Access Level
Root Administrator
This is going to be an issue if the MX entry is domain.com for the domain. If you change the A record for the domain to point to server a, then the MX record must instead be mail.domain.com and mail.domain.com cannot be a CNAME for domain.com (it has to be an A record for mail.domain.com to point to server b). This means you'd have the following on server b for the DNS records on that machine:

domain.com. 14400 IN A server_a_IP#
domain.com. 14400 IN MX 0 mail.domain.com.
mail.domain.com 14400 IN A server_b_IP#

This is the only way what you are describing will properly work. Otherwise, you'll end up having the mail begin routing to server a due to using domain.com for the MX entry and domain.com would be pointing to server a's IP#

Under the above setup, server a will need to ensure to have the domain in /etc/remotedomains file and not listed in /etc/localdomains file.
 

atodea

Member
Apr 23, 2011
16
0
51
Thank you.

It was easier than I thought.

Server A:
1. Create account.
2. Delete DNS zone.

Server B:
Edit DNS, update "www" to Server A IP.

It works and I guess it's also very clean.
 

_NANO_

Registered
Nov 18, 2011
1
0
51
Temuco, Chile, Chile
cPanel Access Level
Reseller Owner
Thank you.

It was easier than I thought.

Server A:
1. Create account.
2. Delete DNS zone.

Server B:
Edit DNS, update "www" to Server A IP.

It works and I guess it's also very clean.
Hi, I just tried this but when I try to delete the dns zone for domain.com in server A, I get this message in WHM:

[h=1]Delete a Dns Zone[/h]


Sorry, domain.com cannot be removed because it is still configured for use on an active account. Please remove the domain from the account by deleting the subdomain, addon domain, parked domain, or account it is linked to. If all else fails, remove it from httpd.conf.
any help?
 

cPanelTristan

Quality Assurance Analyst
Staff member
Oct 2, 2010
7,607
38
248
somewhere over the rainbow
cPanel Access Level
Root Administrator
I'm uncertain why you would need to delete the DNS zone on server A. It doesn't matter if the zone exists on that machine. Simply revise the zone for the MX entries to point to another location on server A or put the domain into /etc/remotedomains to ensure all mail routes off the server. Any other records aren't going to be used anyway because only the A record IP for the domain itself is pointing to the machine and you don't control the DNS on server A for that domain anyway.