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.

Subdomain Mail when site is hosted remotely

Discussion in 'Bind / DNS / Nameserver Issues' started by Studio1337, Feb 9, 2016.

  1. Studio1337

    Studio1337 Registered

    Joined:
    Feb 9, 2016
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Tecas
    cPanel Access Level:
    Root Administrator
    Hello,

    We have an odd hosting situation related to DNS setup on a client, and I just can't seem to get it working properly. I'm hoping someone can give some insights!

    The client is hosting email on our server. They have 4 sites hosted with a Website builder. They have email addresses set up on subdomains, and three of the sites use those subdomains. The Web site builder gave us both CNAME and A Record options to point those subdomains to them, but every effort we've made to point to them results in email disruptions.

    We can't use the CNAMES - the system sets up A records for subdomains that are used for email, and this doesn't allow the CNAMES to be used. This wouldn't be a problem, except when we enter the A Records, MX gets routed to the remote provider as well, which disrupts their mail service on our server.

    I tried setting up separate MX records, which in theory should work just fine, but it's not, and I'm wondering what I've done wrong.

    Right now, the records look like this (they gave us two A records and require both - the primary domain A record is also pointed to the 3rd party server):

    domain 3600 in A 111.111.111.111
    domain 3600 in A 222.222.222.222
    domain 3600 in MX 0 domain.com.

    subdomain1 3600 in A 111.111.111.111
    subdomain1 3600 in A 222.222.222.222
    subdomain1 3600 in MX 0 domain.com.

    subdomain2 3600 in A 111.111.111.111
    subdomain2 3600 in A 222.222.222.222
    subdomain2 3600 in MX 0 domain.com.

    subdomain3 3600 in A 111.111.111.111
    subdomain3 3600 in A 222.222.222.222
    subdomain3 3600 in MX 0 domain.com.

    The primary domain works as expected. The domain displays the 3rd party Web site, but mail routes to the server.

    The subdomains do not work as expected. They display the 3rd party Web sites as they should, but mail is routed to the 3rd party as well, which it should not.

    How should we update this so email sent to subdomains stays on our server, but people accessing those subdomains through their browsers are seeing the 3rd party Web sites?

    Thanks!
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello :)

    Could you setup a separate "A" record for "mx.domain.com" and ensure it points to the IP address of the mail server you want the subdomains to utilize. Then, configure the MX records for your subdomains to point to "mx.domain.com". Assuming the DNS records are handled on the cPanel server, and you want the email handled on the cPanel server, choose "Local Mail Exchanger" under the "Email Routing" section when editing the zone.

    Thank you.
     
  3. Studio1337

    Studio1337 Registered

    Joined:
    Feb 9, 2016
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Tecas
    cPanel Access Level:
    Root Administrator
    Thanks for the response Michael. We ended up solving the problem by pointing the MX entries to the server hostname, and this appeared to solve everything. Do you see any downside to this solution?
     
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
Loading...

Share This Page