opennetadmin / ona

OpenNetAdmin IP Address Management (IPAM) system
opennetadmin.com
GNU General Public License v2.0
137 stars 35 forks source link

Domain based MX records not working properly with sub-domains #65

Closed justinkarabegovic closed 10 years ago

justinkarabegovic commented 10 years ago

When an MX Record without a 'Host' portion of the form entry is created for a sub-domain, say 'sub.example.com' , the resulting entry is:

sub.example.com.sub.example.com. IN MX 10 mail.example.com.

DEFAULT] INFO => Running module: dns_record_add options: name=.sub.example.com&set_mx_preference=10&set_srv_pri=0&set_srv_weight=0&set_pointsto=mail.example.com&cancel=Cancel&submit=Save&domain=sub.example.com&type=MX&ebegin=2014-01-3 13:45:36&addptr=Y&pointsto=mail.example.com&mx_preference=10

However, this works correctly when attempting to set a domain based MX record in the parent domain. Resulting entry is:

example.com. IN MX 10 mail.example.com.

DEFAULT] INFO => Running module: dns_record_add options: name=.example.com&set_mx_preference=10&set_srv_pri=0&set_srv_weight=0&set_pointsto=mail.example.com&cancel=Cancel&submit=Save&domain=example.com&type=MX&ebegin=2014-01-3 13:51:14&addptr=Y&pointsto=mail.example.com&mx_preference=10

As a note: the host 'mail.example.com' is setup correctly with both A and PTR records in all requisite zone files, prior to executing this task.

mattpascoe commented 10 years ago

To gather a bit more information here. Can you tell me exactly how your domain and subdomain are configured in ONA. Did you set up 'sub' with a parent domain of 'example.com' or did you set up 'sub.example.com' as a domain?

My suspicion here is that it is an issue related to the parent domain configuration. The annoying problem I currently have is that the parent domain design is not properly implemented or tested. In my initial attempt to recreate this using my data I don't have any issues but I am not defining any parent domains. I only have domains and subdomains and do not define the parent relationship.

Let me know how you have it set and we can go from here. If you are using parent designation then it might be wise to convert away from that model (really there is not a big difference in the differentiation any more).

justinkarabegovic commented 10 years ago

Yes, I setup a 'sub' with a parent of 'example.com' instead of setting up the sub-domain 'sub.example.com' as a domain .

Is the sub-domain with parent domain a feature that is being deprecated or is it something that is going to be revisited in the future?

mattpascoe commented 10 years ago

Good question. I've thus far been too lazy to look at it at all. If I were to predict it at this point, it will be deprecated. I don't believe that it's original intention was realized and I don't see any benefits anymore to keeping it around. I'd first try and reconfigure the sub domain to not have a parent and be 'sub.example.com' to see if the MX record works for you.

justinkarabegovic commented 10 years ago

Understood.

I have tested by creating the sub-domain 'sub.example.com' as a domain with no parent, and the MX record creation works the same as with a regular domain 'example.com'. I'll go ahead and convert all of my sub-domains with parents over to domains with no parents. This was all tested with ONA 13.03.01

FWIW, I think the parent domain idea had/has merit. However, if the intention was for grouping domains, I can see how there may be other ways of attacking it.

Thanks for your response and also for all your hard work on this product.

mattpascoe commented 10 years ago

Good deal.. glad that works.

I think the parent domain thing boils down to how it is managed and stored in ONA. There is no real need to store them separately when the parent is implied by walking further up the FQDN. The sad part is I think I have forgotten some of the reasons I went down that road in the first place.

I'd say any discussions about its merit are certainly welcome. I'm just at a point now where I dont know I could argue its merits anymore. :)

Thanks for your feedback as well, that helps the project along!