MX records for subdomain

BUGabundo

Verified User
Joined
Dec 18, 2008
Messages
5
Location
PT
I'm not sure if this is a bug or a feature... so help me out.

If you have a subdomain there is no way to add MXs records for it under the https://server:2222/CMD_DNS_CONTROL?domain=MYDOMAIN.TLD

The only way i manage to get this working was to remove the subdomain and re-add it as a domain on its own, so that it has MX controls.

Thanks for your time.
 
If you want any mail features at all you have to add it as a regular domain.
 
You normally do not send email to subdomains.

And if you do, it normally is because there is a separate website running on the subdomain. For instance, a subsidiary.
Therefor adding it as a separate domain makes more sense.
 
Well this feature would be really nice.

E.g. i have a subdomain list.domain.tld which is only used for mail delivery to a seperate server which is used only for mailing lists.

In this case it's Google Apps MX records.

Now i have to create a seperate domain lists.domain.tld, adding NS records to domain.tld zone, which point back to myself. Which is kinda stupid and gives me some problems with zone duplication on my external NS2 server (which I don't own and it only duplicates second level zones).

Or i can add MX records manully into named config file, but those will get overwritten.

So in general in this case just subdomain MX records is a much nicer and better solution.

And I think implementing this feature would be rather straightforward and simple...
 
adding NS records to domain.tld zone

No you don't. When you add lists.domain.tld as a regular domain its own zone is created.

Or i can add MX records manully into named config file, but those will get overwritten.

Not if you do it correctly. http://help.directadmin.com/item.php?id=8

So in general in this case just subdomain MX records is a much nicer and better solution.

It can already be done. Do it in DNS Management.

Give us a real example and I will show you how to do it in just a few simple steps.
 
Let's say I have a domain foobar.lt.

I want all my records to point to the server itself (lets say 1.2.3.4).

Web, FTP AND e-mail are checked on the local server - default DirectAdmin DNS zone settings.

EXCEPT

i want list.foobar.lt e-mail to be delivered to an external server lets say smtp.external.lt

So normally I would just add
Code:
foobar.lt.       14400   IN      A       1.2.3.4
mail    14400   IN      A       1.2.3.4
www     14400   IN      A       1.2.3.4

foobar.lt.       14400   IN      MX      10 mail
list.foobar.lt.  14400   IN      MX      10 smtp.external.lt.
to my foobar.lt zone.

So how do i do that without addding a seperate zone list.foobar.lt. using DirectAdmin?
 
Using DirectAdmin DNS management console i can only add MX records for the main domain (foobar.lt. in this case), because there are only two fields - DNS record value (where the mail should be delivered) and MX priority, but no field to enter the first part of the record.
 
You are correct. The only option I can think of is to add the subdomain as a regular domain.
 
Ok I found a workaround that works for me - manually edit DNS zone file and set the immutable flag ON.

Adding a seperate zone is not fine with me, because my secondary DNS will not duplicate this zone (It's a server provided by .LT domain registry and it only duplicates second level zones).

Of course DirectAdmin will be unable to administer this zone, but this is rather fine with me, though such a feature would be really nice.

Where can I add a feature request?
 
Ok I found a workaround that works for me - manually edit DNS zone file and set the immutable flag ON.

I would have told you that but I thought you were looking for a DirectAdmin solution. You indicated you already knew how to do it manually.

Where can I add a feature request?

You already have.
 
I would have told you that but I thought you were looking for a DirectAdmin solution.

Yes and no. It's not a very nice solution, since the user will not be able to add itself any subdomains for this zone.

It's bad, but not that big of a problem since we use DirectAdmin for our internal server to provide services for our organization subdivisions (we are not a service provider) and this MX subdomain record is required for only one user and one domain. I can instruct the user not to add any subdomains himself, but instead e-mail me. It's acceptable on such a small scale, but if i had like 100 such users - it would be hell.



You indicated you already knew how to do it manually.

Yeah, I knew how to do it manually but forgot about the immutable bit ;) (The problem was that DirectAdmin would overwrite it and all list.foobar.lt. MX records would get changed to foobar.lt. MX records with same destination, since DirectAdmin probably does not even read the first part of MX record). Nice feature would be atleast if DirectAdmin would not touch such DNS records.
 
The problem isn't really that DirectAdmin can't handle it, but that you use a slave nameserver which doesn't work the way the RFCs specify.

If DirectAdmin didn't touch the records it couldn't very well manage them. You can create rather complex templates, but you're right that DirectAdmin can't manage MX records for subdomains in a zone. I'm not sure how that's specified in the RFCs, but I prefer creating a new zone if I'm using more than an A record; it just makes things easier.

The admin can create a new zone without creating a domain or a subdomain, but then only the admin will be able to administer it, so it doesn't really help you with what you want either.

Jeff
 
The problem isn't really that DirectAdmin can't handle it, but that you use a slave nameserver which doesn't work the way the RFCs specify.

Yes, and no. It simply refuses with "Query refused" message if the zone you're asking for is not in the .LT domain registry and does not have ns2.domreg.lt listed as a slave NS for that zone. So naturally third level domains are not listed in registry, since in .lt TLD you register only for second level domains.

It is that way so domain owners who can't afford a real slave NS would be able to use this DomReg (.lt domain registry) provided slave NS. Which is our situation - we can't afford a real slave NS on a seperate physical location.

If DirectAdmin didn't touch the records it couldn't very well manage them.

Well at least there could be some kind of special block comments for parts which DirectAdmin should ignore. I'm not sure if bind zone files support any kind of comments, but if it does it would be rather straightforward to implement it so that it would ignore part of file between 2 special comments.

I'm not sure how that's specified in the RFCs, but I prefer creating a new zone if I'm using more than an A record; it just makes things easier.

Normally I also prefer that, but thing is that in this case I need only an MX record for that subdomain, which is just yet another service for the main domain (like www.foobar.lt. for web, ftp.foobar.lt. for FTP and lists.foobar.lt. for mailing lists) it's just that this service (mailing lists) is handled by external server and also obviously requires not just an A record, but an MX record. So creating those MX records in the foobar.lt. zone is kinda logical and doesn't brake the one-zone for one-site logic about which getUP is talking, since it's yet another service for the same website.

The admin can create a new zone without creating a domain or a subdomain, but then only the admin will be able to administer it, so it doesn't really help you with what you want either.

Well the user won't be able to administer this zone (list.foobar.lt), but atleast it will be able to administer foobar.lt zone normally, as opposed to this "immutable flag" solution :D
 
I suppose bumping this would be better than making a new topic about it.

I also wouldn't mind DA supporting MX records for subdomains. One of our users has 31 MX records tied to subdomains and, whenever they make a change to their DNS through DA, we have to redo all of the MX records for them. The only solutions at this point are to do that or mark the zone file immutable, which prevents them from making any changes to it on their own schedule.

Did this feature sort of fall to the bottom of the priority list, or is there an unexplored alternative solution to this?
 
Do your subdomains have their own zone files or are they listed in the main domain zone file? If the subdomains have their own zone files multiple MX records should work properly and be saved across updates.

Jeff
 
They're listed within the main zone file. I suppose if they're never going to get changed, I could add 31 subdomains to the DNS within DA. It's much easier to have all of them in one file though.
 
The DirectAdmin DNS user interface doesn't allow adding MX records for anything except the main domain name in a zone, so the only way it can be done within DirectAdmin is to create a zone for each subdomain. The limitation is in DirectAdmin, not in how BIND or DNS works.

Jeff
 
Back
Top