I've a SAAS based content management software that's working on a CentOS 7 based virtual machine on my MS Azure. The system works like the wordpress. Users can create their own websites by submitting a form that contains the name of the website to be created. Of course they can use their own domain names by adding a domain CNAME record that points to my virtual machine's dns, mysystem.westeurope.cloudapp.azure.com which is provided by Microsoft. It works fine but there is a problem. I've also an e-mail server which is working on a different machine with a different IP address. I want users to create e-mail accounts with their own domain names. I tried to set domains' MX records point to mail server's IP but it doesn't work.
I want to create my own custom nameservers. For example ns1.mysystem.com ns2.mysystem.com. My users'll set those nameservers for their domains instead of adding CNAME or MX records. Their website will work on my virtual machine on my MS Azure and their e-mails will work on my e-mail server.
Basically I want them only to set nameservers. My azure should run websites and points to my e-mail server for each domain.
How can I do this? Does DNS Zone system work for me? Where should I look at?