Skip to main content

Edit Zone Templates - MX Problem

Comments

6 comments

  • User Avatar
    cPRex Jurassic Moderator

    Hey hey!  Did you make sure to use the "standardvirtualftp" template when you made these changes?  Also, %maildomain% is "the hostname of the server that handles the domain’s mail" so it could be that it's pulling the correct value and that value just isn't what you expect.

    When I edit the template on my end to add a random record to a new domain, I'm seeing the same behavior as you in the zone:

    totallyrandomdomain.com.        14400   IN      TXT     "totallyrandomdomain.com"

    so I'm guessing it's more of an issue with the variable not pulling the expected content.  Can you let me know what you're hoping for that variable to pull?

    0
  • User Avatar
    mtindor

    If Vatra is wanting the MX's to be created pointing to mail.domain.com instead of domain.com

    1.  Make sure you add an appropriate mail.domain.com A-record pointing to the IP address of the server

    2.  That template modification doesn't look correct.   Maybe they really want:

    %domain%.    %ttl%    IN    MX    0    mail.%domain%.

    If the domain is xyz.com, that should create an MX record, priority 0, referencing mail.xy.com

     

    1
  • User Avatar
    vatra

    I've made the same change in all three templates.

    I thought that %maildomain% was mail.example.com. That is what I want to pull. mail.%domain% was a solution.

    Note: My server's hostname, server.example.com, handles outgoing mail by default. But MX is about incoming mail, and regardless of what I put in the template: %domain% or %maildomain%, the domain's apex is pulled, not the server hostname.

     

    1
  • User Avatar
    cPRex Jurassic Moderator

    I think that is what is supposed to happen here - I also use mail.%domain% when I want to manually make it into the mail subdomain to use a custom MX record elsewhere.

    1
  • User Avatar
    AzeDK

    cPRex what is the purpose of 

    %maildomain%.

    vs just using

    %domain%.

    I noticed its default for MX in latest version of cPanel, in Edit Zone Templates.

    Would much rather want mail.%domain%. as the default MX and DNS A/AAAA pointing from mail.%domain%. to %ip%

    This would avoid most cases of main ip and www being used for external hosts like Shopify, when the cPanel user want mail hosting to work in cPanel.

    Example of preferred default standardvirtualftp

    ; cPanel %cpversion%
    ; Zone file for %domain%
    $TTL %ttl%
    @      %nsttl%    IN      SOA     %nameserver%. %rpemail%. (
            %serial%    ; serial, todays date+todays
            3600        ; refresh, seconds
            1800        ; retry, seconds
            1209600        ; expire, seconds
            86400 )        ; minimum, seconds

    %domain%. %nsttl% IN NS %nameserver%.
    %domain%. %nsttl% IN NS %nameserver2%.
    %domain%. %nsttl% IN NS %nameserver3%.
    %domain%. %nsttl% IN NS %nameserver4%.

    %nameserverentry%. IN A %nameservera%
    %nameserverentry2%. IN A %nameservera2%
    %nameserverentry3%. IN A %nameservera3%
    %nameserverentry4%. IN A %nameservera4%

    %domain%. IN A %ip%
    mail IN A %ip%

    %domain%. IN AAAA %ipv6%
    mail IN AAAA %ipv6%

    %domain%. IN MX 0 mail.%domain%.

    www IN CNAME %domain%.
    ftp IN A %ftpip%
    ftp IN AAAA %ipv6%

    0
  • User Avatar
    cPRex Jurassic Moderator

    These can *potentially* be different as maildomain is hostname of the server that handles the domain’s mail, vs just domain being the main domain of the zone file itself.  I'm betting in most cases these end up being the same, though.

    0

Please sign in to leave a comment.