Jcats

Well-Known Member
PartnerNOC
May 25, 2011
807
160
168
New Jersey
cPanel Access Level
DataCenter Provider
You would be better off using a service like

DNS Failover and Monitoring | DNS Made Easy

otherwise, you could assign multiple A Records for each domain but this will not ensure the traffic is only routed to the 2nd server if it fails.
 

John Schmerold

Well-Known Member
Apr 21, 2004
81
6
158
st. louis
cPanel Access Level
Root Administrator
We have been using dnsmadeeasy for as long as I can remember - love their service, wish there was an easy way to sync cpanel DNS with dnsmadeeasy.

How do I assign multiple A records for each domain? I don't see that option in gui, is it a command line thing?
 

Jcats

Well-Known Member
PartnerNOC
May 25, 2011
807
160
168
New Jersey
cPanel Access Level
DataCenter Provider

Attachments

John Schmerold

Well-Known Member
Apr 21, 2004
81
6
158
st. louis
cPanel Access Level
Root Administrator
Thanks for the dnsmadeeasy link, I missed that.

Editing the dns record didn't tell apache to use that second IP address, I made the change in DNS, restarted httpd & dns, still got "Sorry....If you are the owner of this website, please contact your hosting provider"
 

Jcats

Well-Known Member
PartnerNOC
May 25, 2011
807
160
168
New Jersey
cPanel Access Level
DataCenter Provider
You have 2 servers correct?

Or are you saying you have 2 different IPs on one server?
 

Jcats

Well-Known Member
PartnerNOC
May 25, 2011
807
160
168
New Jersey
cPanel Access Level
DataCenter Provider
Oh sorry, I misunderstood the initial question then. I don't think this is possible with cPanel even with using an include but basically the apache virtualhost has to look like this:

Code:
<VirtualHost 1.1.1.1:80 2.2.2.2:80>
or if you literally only have those 2 IP's listening on all interfaces like:

Code:
<VirtualHost *:80>
but this would only work if you manually changed httpd.conf which will be overwritten..

Unless you modified the virtualhost template:

Code:
/var/cpanel/templates/apache2_4/vhost.default
that first line

Code:
<VirtualHost[% FOREACH ipblock IN vhost.ips %] [% ipblock.ip %]:[% ipblock.port %][% END %]>
changing it to

Code:
<VirtualHost *:80>
then run

Code:
/scripts/rebuildhttpdconf
Code:
/scripts/restartsrv_apache
clear your browser history then try browsing to the site again now
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,267
463
Hello,

While it's supported by Apache 2.4, I don't believe cPanel/WHM will recognize multiple IP addresses assigned to a single Virtual Host. I recommend opening a feature request if it's an option you want to see configurable in WHM:

Submit A Feature Request

Thank you.
 
  • Like
Reactions: luissquall