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.

Local Mail Exchanger or Remote?

Discussion in 'E-mail Discussions' started by jayba, Jun 4, 2011.

  1. jayba

    jayba Registered

    Joined:
    May 21, 2011
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    Hello
    I have a client on my VPS who only wants me to host the website, the emails are sticking with their current provider (Easily UK)

    At present, when a user submits a form from the website, ie. mywebsite.com, its supposed to send that email to info@mywebsite.com, but doesnt, as Im thinking its trying to route the mail to itself.

    So likewise, if i sent any emails to info@mywebsite.com, from any domain hosted on the same VPS, they never arrive, so i guess its an MX record or something like local or remote mail exchanger settings i have to re-configure?

    And just to re-iterate, the emails are hosted with another provider, not on my VPS, and they work fine.

    Help!
     
  2. NixTree

    NixTree Well-Known Member

    Joined:
    Aug 19, 2010
    Messages:
    386
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    Gods Own Country
    cPanel Access Level:
    Root Administrator
    Hi,

    Remove that domain from /etc/localdomains and add it to /etc/remotedomains.

    Thank you.
     
  3. jayba

    jayba Registered

    Joined:
    May 21, 2011
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    Hi, thanks for your reply, where do i find that in WHM GUI? Im not familiar with the command line control
     
  4. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    In WHM > DNS Functions > Edit DNS Zone area, select the domain in question and click the "Edit" button. In the new screen that loads, scroll to the bottom and you will see the following:

    Select the "Remote Mail Exchanger" radio button and click the "Save" button, this will switch the domain from /etc/localdomains to /etc/remotedomains file.
     
  5. DanielWScott

    DanielWScott Registered

    Joined:
    Mar 19, 2012
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Hi there,

    I'm curious as to how to make this local vs remote domain change in CPanel / WHM if you don't want to host the DNS zone for the given domain (and have removed the zone from the local DNS server)

    I'm in the situation where I just want to host the website (and no other services) for a given domain, on a CPanel account. The DNS and email are run from an external server. Ideally I don't want to have an out of sync "local" DNS zone with MX records and the like which I need to keep in sync with the real public "master" DNS server.

    Removing the DNS zone using WHM seems to work fine (the CPanel server starts seeing the same DNS information as the rest of the internet, from the external DNS server) - however I lose the ability to select between remote/local mail exchanger in the WHM GUI.

    I've tried manually editing the localdomains and remotedomains files, but if I run /scripts/mailperm then CPanel just overwrites them - so I suspect hand editing the files is a bad idea.

    Is it possible to achieve this setup (no Zone file / manually selected "remote" mail exchanger for a domain / apache still serving the website using host header filtering)? Or am I stuck with having to keep a "bogus" DNS zone on my Cpanel server for the benefit of local name/mx resolution?

    Cheers

    Daniel
     
    #5 DanielWScott, Mar 19, 2012
    Last edited: Mar 19, 2012
  6. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    You would need to have a DNS zone locally for the domain. That's the approved way to handle it.
     
  7. DanielWScott

    DanielWScott Registered

    Joined:
    Mar 19, 2012
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Hi Tristan,

    Thanks for the reply. So I take it there is *no* other way in the CPanel UI / configuration to tell the mail server that a domain is remote, other than to keep the zone in the local DNS and use the radio buttons on the zone editor page?

    Obviously I would ideally like to avoid having the DNS zone on the CPanel server, since any updates made to the live MX configuration won't be visible to my CPanel server, but if this is the way it has to be then this is the way it has to be.

    Does anyone else have any suggestions that might not be officially sanctioned, but will play nice with Cpanel (and not be subject to being overwritten at "random" times?)

    Daniel
     
  8. DanielWScott

    DanielWScott Registered

    Joined:
    Mar 19, 2012
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    For the possible benefit of others out there, I think I sorted a way around this.

    1. I've made the account's primary domain a subdomain of the domain I actually want to host. For example, assuming that mydomain.com is the domain I want the CPanel account to host a website for I have set the primary domain for the account to www.mydomain.com. I then cleaned up the DNS zone and removed the www A entry (which would be for www.www.mydomain.com). The MX record for this zone doesn't matter since I won't be using any @www.mydomain.com addresses.
    2. I then "parked" the domain mydomain.com on the CPanel account.
    3. Then I removed the DNS zone for mydomain.com from the CPanel server using WHM.
    4. Finally, I added mydomain.com to the /etc/remotedomains file.


    Using this configuration seems to "stick" (i.e. restarting services, restaritng the server, running /scripts/mailperm all leave the configuration intact and mail sent to @mydomain.com addresses from the CPanel server is correctly routed to the external mail server).

    Others may want to chime in if this is not a sensible workaround (or may have some nasty hidden by-products), but it seems to be working ok for me :)
     
Loading...

Share This Page