Subdomains created through Domain Setup

zmippie

Verified User
Joined
Apr 19, 2015
Messages
159
I'm in the process of writing a DirectAdmin DNS replication script that interfaces with Vultr's DNS API. I've run into a problem though. DirectAdmin allows me to create subdomains in two different ways: through "Subdomain Management" (runs out a of a subdirectory in root domain's webroot), and through "Domain Setup" (creates a seperate domain folder with its own webroot), where I just use subname.mydomain.com upon creation. The latter method is often the most preferable to me, and it works nicely. It does create an extra zone file and associated DNS records.

The problem is that Vultr's API doesn't seem to accept these "subdomains" when creating a new domain through their API: "Subdomains are not permitted status: 400". What will happen if I remove the DNS information for these "subdomains" and add only an A record to the root domain's DNS records?
I'm not entirely sure why this type of "subdomain" is even possible/allowed, DNS-wise. I'm using it just for webserver access, but these domains get their own SPF, mail and DKIM records, just like any root domain. Will these resolve if I add the records to the root domain's DNS records? Love to hear from the experts.
 
Small update: it seems that when I delete the zone for these "subdomains" (e.g. subname.mydomain.com) entirely (DNS Administration -> check domain -> Delete), but make sure it has its entries in the root domain (mydomain.com), it indeed resolves. Just removing all entries from the zone (except for NS records, that give you a warning) did not work. Will test more, but am still interested to hear what the experts have to say.
 
"Subdomain Management" (runs out a of a subdirectory in root domain's webroot),
I'm not an expert, but this is how it was before, it was like /home/user/domains/domain.com/public_html/sub but it's not like that anymore.
Nowadays by default it's created in another way like in /home/user/domains/sub.domain.com/public_html when doing via the web interface.
So within the same account, but with it's own webroot.
No need anymore to use the "domain setup" option to create it this way.

Unless the API is not updated yet to this default. I don't know about API's.
 
Nowadays by default it's created in another way like in /home/user/domains/sub.domain.com/public_html when doing via the web interface.
Seriously? That would be a really nice change, because you don't want your main domain webroot directory cluttered with subdomain stuff. I'm running 1.643, I'll give it a try. In that case, my "Domain Setup"-hack won't be needed anymore, and I won't be creating these weird zone files.
I'm not using the API for creating these subdomains though, just to read every domain and every DNS record in order to replicate them elsewhere with the same values (seondary DNS).
 
Just tested it with 1.643, the "mysub" subdirectory was placed in the main domain's webroot folder :-(

I'll update.
 
If i remember correctly, its also possible to set an own custom path to this subdomain docroot.
 
Back
Top