Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

One site, multiple IP addresses

Discussion in 'Bind / DNS / Nameserver Issues' started by John Schmerold, Jul 27, 2017.

  1. John Schmerold

    John Schmerold Well-Known Member

    Joined:
    Apr 21, 2004
    Messages:
    59
    Likes Received:
    3
    Trophy Points:
    158
    Location:
    st. louis
    cPanel Access Level:
    Root Administrator
    We have 2 ISPs, I want all sites accessible via both IP addresses. Is that possible?
     
  2. 24x7server

    24x7server Well-Known Member

    Joined:
    Apr 17, 2013
    Messages:
    1,484
    Likes Received:
    60
    Trophy Points:
    28
    Location:
    India
    cPanel Access Level:
    Root Administrator
    Hi,

    You can create multiple shared IPs on a server and use those IPs for multiple websites/account..
     
  3. John Schmerold

    John Schmerold Well-Known Member

    Joined:
    Apr 21, 2004
    Messages:
    59
    Likes Received:
    3
    Trophy Points:
    158
    Location:
    st. louis
    cPanel Access Level:
    Root Administrator
    Thank you, but what I am trying to do is use two IP addresses for one url so that if one ISP is down, access to the site can be satisfied via DNS round-robin.
     
  4. Jcats

    Jcats Well-Known Member

    Joined:
    May 25, 2011
    Messages:
    599
    Likes Received:
    92
    Trophy Points:
    153
    Location:
    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.
     
  5. John Schmerold

    John Schmerold Well-Known Member

    Joined:
    Apr 21, 2004
    Messages:
    59
    Likes Received:
    3
    Trophy Points:
    158
    Location:
    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?
     
  6. Jcats

    Jcats Well-Known Member

    Joined:
    May 25, 2011
    Messages:
    599
    Likes Received:
    92
    Trophy Points:
    153
    Location:
    New Jersey
    cPanel Access Level:
    DataCenter Provider

    Attached Files:

  7. John Schmerold

    John Schmerold Well-Known Member

    Joined:
    Apr 21, 2004
    Messages:
    59
    Likes Received:
    3
    Trophy Points:
    158
    Location:
    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"
     
  8. Jcats

    Jcats Well-Known Member

    Joined:
    May 25, 2011
    Messages:
    599
    Likes Received:
    92
    Trophy Points:
    153
    Location:
    New Jersey
    cPanel Access Level:
    DataCenter Provider
    You have 2 servers correct?

    Or are you saying you have 2 different IPs on one server?
     
  9. John Schmerold

    John Schmerold Well-Known Member

    Joined:
    Apr 21, 2004
    Messages:
    59
    Likes Received:
    3
    Trophy Points:
    158
    Location:
    st. louis
    cPanel Access Level:
    Root Administrator
    2 different IPs on one server
     
  10. Jcats

    Jcats Well-Known Member

    Joined:
    May 25, 2011
    Messages:
    599
    Likes Received:
    92
    Trophy Points:
    153
    Location:
    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
     
  11. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    38,658
    Likes Received:
    1,425
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    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.
     
  12. John Schmerold

    John Schmerold Well-Known Member

    Joined:
    Apr 21, 2004
    Messages:
    59
    Likes Received:
    3
    Trophy Points:
    158
    Location:
    st. louis
    cPanel Access Level:
    Root Administrator
    OK. Thank you.
     
Loading...

Share This Page