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!

Problems setting up multiple domains with one physical server

Discussion in 'Bind/DNS/Nameserver' started by Spork Schivago, Jan 10, 2018.

  1. Spork Schivago

    Spork Schivago Well-Known Member

    Joined:
    Jan 21, 2016
    Messages:
    594
    Likes Received:
    63
    Trophy Points:
    28
    Location:
    corning, ny
    cPanel Access Level:
    Root Administrator
    Hello,

    We're in the process of setting up a small enterprise now and originally, I had one domain name and one virtual private server.

    Now I have a total of three domain names and one physical server in my house, one virtual private server.

    I've registered the two domain names properly but had some questions about configuring them in WHM. I've created a new user for the person who will be in charge of the two domains. The domains will point to the same website (one is a .net, the other is a .com). So essentially, I want just one website under this users name (we'll pretend his username is john). So when someone goes to https://www.domain2.com or https://www.domain3.net, it shows /home/john/public_html/index.html (or .php or whatever).

    In WHM, I've created two zones, domain2 and domain3. I don't think I have the records right though. I've created A and AAAA "glue" records or whatever you call them for both domains. I have one IPv4 address to share for all three servers, and I have a very large number of IPv6 addresses to share for each server.

    I called them:
    Code:
    # zone for domain2.com
    ns1.domain2.com
    ns2.domain2.com
    
    # zone for domain3.net
    ns1.domain3.net
    ns2.domain3.net
    
    For the soa part, should I be putting ns1.domain2.com. for domain2 and ns1.domain3.net. for domain3?

    And should I be created NS records called ns1 and ns2 on those two domains as well? Or do I need to be using the NS records for domain1?

    Finally, I don't think this is possible, but is there anyway to have individual reverse PTR records for the domains? When I ping domain2.com or domain3.net, I see a reply from hostname.domain1.com.

    I'd rather have it when I ping domain2.com, it shows a reply from hostname.domain2.com, when I ping domain3.net, it shows a reply from hostname.domain3.net. Otherwise, mail will probably be all messed up and it just looks weird.
     
  2. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    16,436
    Likes Received:
    416
    Trophy Points:
    583
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    I’m curious why you wouldn’t just add the new domains to the original account, as Addon domains, via the accounts cPanel?
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. Spork Schivago

    Spork Schivago Well-Known Member

    Joined:
    Jan 21, 2016
    Messages:
    594
    Likes Received:
    63
    Trophy Points:
    28
    Location:
    corning, ny
    cPanel Access Level:
    Root Administrator
    That is a good and valid question. I might be wrong here, so please correct if I am, but we need separation between the first domain and the last two. The last two are going to be maintained by a co-worker, whereas I maintain the first one, if that makes sense.

    I do not want them having access to my domain or any of its settings. I also do not want him having access to my user account, he needs his own.

    If I created an Add-on domain, would I be able to assign that add-on domain to just his user account, where he could update his own DNS records, etc? Or would he need my account to do all that?

    Thank you.

    This is the first time I've ever tried having more than one domain, for what it's worth. So I might be totally doing it wrong and maybe your way is the way it should be done? Eventually, we want to set it up where traffic tries to go to the VPS, but if the VPS is down, it redirects to another IP address. I don't know if that is relevant at this point though.

    Thank you.
     
  4. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    16,436
    Likes Received:
    416
    Trophy Points:
    583
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    Well, assuming you created a second account, that account could have a main domain and an addon domain, for this other user you mention. That keeps your main domain separate and access only to you.

    Not my way, the cPanel way. Keeping it easy is the best way to go, IMHO.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  5. Spork Schivago

    Spork Schivago Well-Known Member

    Joined:
    Jan 21, 2016
    Messages:
    594
    Likes Received:
    63
    Trophy Points:
    28
    Location:
    corning, ny
    cPanel Access Level:
    Root Administrator
    That's essentially what I did. I created a second account, which has the domain2.com assigned to it, then I added a the third domain, and assigned the that second user to the third domain, domain3.net.

    I'm just not sure about how to properly configure the DNS zones now. I can start over, and this time, specifically use the add-on domain. But I'm not sure I can have more than one reverse DNS ptr per IPv4 address. I have just that one IPv4 address, so I think it needs to be set to one of the domains. I don't think I can assign it to three different domains, or am I wrong? I want it so when they ping domain2.com, it returns hostname.domain2.com, when they ping domain3.net, it returns hostname.domain3.net. Right now, I ping any of the three, it returns hostname.domain1.com

    Also, I'm struggling with the proper DNS zone entries. Should I be setting the nameservers and SOA entry to ns1.domain(number).(extension) for each domain?

    I'm sorry if some of this sounds kind of trivial. My best friend killed himself in my backyard and I had to watch, so I'm just trying to keep myself busy so I don't have to think about it anymore.

    Thanks.
     
  6. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    16,436
    Likes Received:
    416
    Trophy Points:
    583
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    I'm sorry to hear that. :(

    Assuming the server hostname itself is setup properly, adding the domains normally is the way to go. Email from all accounts will be sent from the main hostname.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
    Spork Schivago likes this.
  7. Spork Schivago

    Spork Schivago Well-Known Member

    Joined:
    Jan 21, 2016
    Messages:
    594
    Likes Received:
    63
    Trophy Points:
    28
    Location:
    corning, ny
    cPanel Access Level:
    Root Administrator
    Thank you.

    Email from all accounts will be sent from the main hostname....but will they be sent from the main domain? Or domain2 / domain3, respectfully? Still not sure on the DNS records, but we need it when we ping domain2.com, there's a reverse pointer record that shows domain2.com responding, and when we ping hostname.domain3.net, we'd like hostname.domain3.net to showup. We'd be okay with domain2.com and domain3.net showing the same reverse PTR record, but we don't want them showing hostname.domain1.com....

    I can show what I have for the current zones, if you think it'd help (minus IP addresses and using generic records). Thanks for the help.
     
  8. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    16,436
    Likes Received:
    416
    Trophy Points:
    583
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    There is only one host.example.com on your server. Email comes from host.example.com. You can ping host.example.com and you can ping example2.com, but you can't ping host.example2.com, it doesn't exist.

    IMHO, you shouldn't have to touch the zone files for any of this. cPanel should take care of it for you. With proper host.example.com server setup including nameservers of course. Adding multiple new accounts added normally, should work out of the box.

    My apologies here if I'm just misunderstanding what you're hoping to do and I'm looking at this all wrong. But, it seems to me you're over-engineering the task you want to complete.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  9. Spork Schivago

    Spork Schivago Well-Known Member

    Joined:
    Jan 21, 2016
    Messages:
    594
    Likes Received:
    63
    Trophy Points:
    28
    Location:
    corning, ny
    cPanel Access Level:
    Root Administrator
    hostname I believe is setup properly, but I think dns zones need to be edited with my setup anyway, because of certain features cPanel currently lacks. Things change so quickly though, perhaps now they provide those options. For example, in order to get Google not to mark e-mails sent by the hostname as spam, I had to manually edit the zone. I have dmarc and SPF records setup. Something like this:
    Code:
    hostname      14400      IN   A      192.168.2.2
    hostname      14400      IN   AAAA      fe80::c971:25de:6618:2bab
    hostname      14400      IN   TXT   "v=spf1 +a +a:hostname.example1.com +mx +ip4:192.168.1.2 +ip6:fe80::c971:25de:6618:2bab ~all"
    default._domainkey.hostname     14400     IN   TXT "v=DKIM1; k=rsa; p=<key1>" <key2>;
    _dmarc    14400   IN   TXT   "v=DMARC1; p=quarantine; sp=quarantine; adkim=r; aspf=r; pct=100; fo=1; rf=afrf; ri=86400; rua=mailto:me@example1.com; ruf=mailto:me@example1.com"
    
    Regardless, there's no way to have a reverse PTR record setup for each domain without having separate virtual servers for each domain? Also, there's no way to setup separate mail servers so mail comes from hostname.example2.com or hostname.example3.net, plus still have one come from hostname.example.1.com, without having a seperate server? Even if mail goes hostname.example1.com, so long as it passes the spam filters and shows that it's from someone@example2.com or someone@example3.net (haven't decided which one we'll use, but we registered both), that'd be fine.

    We just can't have it failing spam, that would be extremely bad for business, nor can we have it all having an @example1.com address.

    Went to the funeral yesterday, so now I'll have more time to dedicate to this.
     
    #9 Spork Schivago, Jan 17, 2018
    Last edited: Jan 17, 2018
  10. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    16,436
    Likes Received:
    416
    Trophy Points:
    583
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    Do you have a dedicated business account with your ISP and a fast connection?

    You can pick up an inexpensive VPS for next to nothing these days and avoid many problems you face setting up a home server. DNS being one of the most problematic parts of a home server, I think.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  11. Spork Schivago

    Spork Schivago Well-Known Member

    Joined:
    Jan 21, 2016
    Messages:
    594
    Likes Received:
    63
    Trophy Points:
    28
    Location:
    corning, ny
    cPanel Access Level:
    Root Administrator
    No, we're trying to switch to another company, but they haven't called us back yet. The switch we haven't, with the setup we want, just won't work with our current gateway device (A cable modem from Spectrum). We need VLAN tagging, etc. Upgrading to a better cable modem doesn't help. They overwrite the firmware with their custom firmware, which cripples the cable modem.

    We plan on having a shared fiber line until the business takes off.

    I don't mind setting up the DNS server, either at home, or at work. Normally, I edit the zones through a console ssh connection, using my favourite text editor. I'm currently using a master / slave setup. I've never setup an authoritative dns server before and I'd rather not do that.

    I'd rather learn how everything works then just run some script that does stuff for me, so when something goes wrong, I can figure it out on my own what went wrong.

    Right now, our connection is only 20up / 100 down, at the house. With dedicated fiber, we'd have a 1Gbps both ways, but that's 2,500$ a month that we cannot afford at this moment and are not quite ready for that. The idea was to do it in baby steps. Use the current VPS that I'm already paying for, setup the new domains using the same server, etc.

    I thought this was what cPanel was used for. To rent out a server I have to multiple users, and charge them per domain or something. I thought it was designed for me to run the main account as root, and give them access to each of their slice of the server....if I need another VPS for the new domain, I'm missing something here....

    When I created the second user, the one who will maintain the two new domains (which should be identical to each other, one should just redirect people to the second), it asked for me to assign a domain name to that account. I did that. Then I created a second zone for the third domain. I'll delete that third domain and try the add-on to see what happens.
     
  12. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    16,436
    Likes Received:
    416
    Trophy Points:
    583
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    My suggestion about getting a VPS was meant as an alternative to setting up a home server to run a business off of. You can host many many websites on a proper VPS setup correctly, and is why I mentioned it.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  13. Spork Schivago

    Spork Schivago Well-Known Member

    Joined:
    Jan 21, 2016
    Messages:
    594
    Likes Received:
    63
    Trophy Points:
    28
    Location:
    corning, ny
    cPanel Access Level:
    Root Administrator
    That's what I'm trying to do. Setup another website on a proper VPS. Eventually, we'll set up redundancy somehow, where it uses the main server at my house, and if that fails (goes down, whatever), people are directed to the Linode VPS. But that is way down the way.
     
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice