Custom DNS

I have a domain where the MX record points to another server. I edited the ns zone manualy and it works, but every time I add a new domain in EHCP or do a Sync DNS the MX record is changed back to point to my server. Is there any way to get around this?

Yes, there is a way,
what causes that you told: dnszonetemplate file in ehcp dir already has an mx record. since this is a template, it is applied to all domains every time sync dns is run.

To overcome this: you need to edit dnszonetemplate file and remove that mx record, then, add mx for your domain.. But this time, you need to manually add mx for every domain you have as custom dns... This may be some difficult if you have many domains...

If you have many (more than 20) domains, let me know, i will try to implement in code a new way for custom mx record for some domains..

did this help ?

Maybe it would be easier if you copied the template's content to a mysql table and make a row for each domain, then rebuild the zone files from the database. This way users could edit their dns records and have different records for each domain.

I don't have many domains, so I can fix this by hand.

Yes i agree with this idea.
It's easier to manage