DNS Zone Template for sMX

Our sMX panel makes use of secondary MX record entries to facilitate mail delivery to the sMX server. MX records include a 'weight' value and this value is used to determine the priority of mailserver delivery. Secondary MX entries are determined by having a higher relative weight than the record associated with the primary mailserver. The numbers themselves are not relevant as absolute values so much as they are as compared to other weights. For instance, consider for mail1 and mail2 the following entries that will function identically:

example.com    3600   IN  MX  1   mail1.example.com
example.com    3600   IN  MX  2   mail2.example.com

example.com    3600   IN  MX  10   mail1.example.com
example.com    3600   IN  MX  20   mail2.example.com
example.com    3600   IN  MX  5      mail1.example.com
example.com    3600   IN  MX  2000   mail2.example.com

Mail1 would be considered the 'primary' mailserver and mail2 would be considered the 'secondary' mailserver in these cases. Wikipedia has a nice writeup on the function of weights for a more verbose description for the inquisitive:MX Record Priorities. For this tutorial, we'll stick to 0 for primary MX servers and 10 for secondary ones.

Editing the Zone Template

In order to allow newly create accounts to automatically be setup for use with an sMX server, the default zone templates need to be modified. In the WHM, jump to Main » DNS Functions » Edit Zone Templates and select the zone template you wish to edit. Please see this guide for information on which template to edit. A sample standard template has been included below with the SMX modification.

; cPanel %cpversion%
; Zone file for %domain%
$TTL %ttl%
@      %nsttl%	IN      SOA     %nameserver%. %rpemail%. (
		%serial%	; serial, todays date+todays
		86400		; refresh, seconds
		7200		; retry, seconds
		3600000		; 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%

localhost.%domain%. IN A

%domain%. IN MX 0 %domain%.
%domain%. IN MX 10 smx.yourdomain.com. ; add this line and change to your SMX hostname

mail IN CNAME %domain%.
www IN CNAME %domain%.
ftp IN CNAME %domain%.

Note that the part that reads smx.yourdomain.com needs to be changed to a valid hostname for your sMX server. Once done performing the edit click the Save button and you're all set!

Existing Domain Zones

The sMX plugin will automatically install backup MX records for all of the existing zones on each clustered server. The zone template change above is for domains added after the initial sMX configuration.