META: Subdomain discussion (long)

Annette

Well-Known Member
PartnerNOC
Aug 12, 2001
445
0
316
After dealing with subdomain issues for the umpteenth time, I'd like to get some input from people before I make this a formal feature request - and make sure that I understand how the subdomain adder works behind the scenes.

The continual issue with the resolv.conf error tells me there is a problem somewhere. This error will occur on a server where some accounts can add subs without any problem whatsoever - whether subdomains have been specifically enabled or not - and others simply cannot add them, no matter what. Obviously, there is no real problem with resolv.conf, nor is there a problem with the domains themselves not resolving, since they do. In addition, when using the move script between servers, we noted that accounts with subdomains would have some of those subs created without issue, and other, already-existing subs on the same account simply would not be created - they generated the resolv.conf error, which further tells me that it is a bogus message.

I'd like to know what the script does when it tries to add a subdomain. What exactly is it checking for when it runs? If it is trying to resolve the domain to an IP, why isn't it finding it for some when it finds it for others on the very same servers? Is it trying to check against local named or against the master nameserver (if in a cluster)?

What I'd like to see, dependent on the answers to the above, is the system simply look against local named (or even httpd.conf, since that would have the IP associated with a domain that is already set up), get the IP, and set up the subdomain appropriately with all of the relevant entries. If the account already has one or more subs set up, then it can grep against the zone file directly to see the IP address and then make the appropriate entries for the new sub to be added.

I like the subdomain adder, I really do - when it works. However, it's about 50-50 on the actual working part, and when it doesn't work, it's like being back at Alabanza and having to do them all manually.

If anyone else has some thoughts (not rants, please - do that elsewhere) about this function, please feel free to join in. I would like to get something from the horse's mouth (so to speak) about how the sub adder actually functions to get a better feel for that and for how a feature request should be worded to get the most effective use out of this function.

Thanks.
 

feanor

Well-Known Member
Aug 13, 2001
835
0
316
...........Bumping this up...........

I am curious as the the status of this, EXTREMELY anxious to see input the darkorb team might be able to spawn

I'm assuming the term &subdomain& here still means &a third-level (vanity) type domain& such as blah.powersurge.net, instead of root-level domains?
 

Annette

Well-Known Member
PartnerNOC
Aug 12, 2001
445
0
316
I suppose I should have been explicit on that point, thanks - subdomain in this context does indeed refer to sub.domain.com, with the relevant httpd entry for DocumentRoot pointing to /home/user/public_html/sub. Additionally, this would be for non-standalone accounts; i.e., this is for the general use addition of subdomains via a user control panel, not for more specialized accounts where sub.domain.com is an account separate from domain.com for whatever reason.
 

Site5-Matt

Well-Known Member
Aug 10, 2001
79
0
306
Hi Annette,

I definitely agree--we were having massive issues with this on our shared servers, which prompted me to go through the source to find the cause. It aould appear that the way that Cpanel currently looks up subdomains is by checking in /var/named... which isn't always relevant on all servers.

I've added in an option that will allow you to tell Cpanel to just add the subdomain regardless of the DNS entry. It will pull the main account's IP address right from httpd.conf, so it will work even before their DNS is transfered to your servers.

To enable this functionality, simply touch the file /etc/useoldsubs

Matt
 

Annette

Well-Known Member
PartnerNOC
Aug 12, 2001
445
0
316
Ah - now that is handy, thanks very much. It is also exactly what we're after, so that we don't end up with subs that point off to the original site IP when for any reason the resolution is picked up there.
 
B

bdraco

Guest
[quote:1f12d526fa][i:1f12d526fa]Originally posted by Site5-Matt[/i:1f12d526fa]

Hi Annette,

I definitely agree--we were having massive issues with this on our shared servers, which prompted me to go through the source to find the cause. It aould appear that the way that Cpanel currently looks up subdomains is by checking in /var/named... which isn't always relevant on all servers.

I've added in an option that will allow you to tell Cpanel to just add the subdomain regardless of the DNS entry. It will pull the main account's IP address right from httpd.conf, so it will work even before their DNS is transfered to your servers.

To enable this functionality, simply touch the file /etc/useoldsubs

Matt[/quote:1f12d526fa]

I've just changed it so that it will use matt httpd.conf lookup if it fails to get the ip from /var/named
 
B

bdraco

Guest
[quote:0100beae13][i:0100beae13]Originally posted by Annette[/i:0100beae13]

I suppose I should have been explicit on that point, thanks - subdomain in this context does indeed refer to sub.domain.com, with the relevant httpd entry for DocumentRoot pointing to /home/user/public_html/sub. Additionally, this would be for non-standalone accounts; i.e., this is for the general use addition of subdomains via a user control panel, not for more specialized accounts where sub.domain.com is an account separate from domain.com for whatever reason.[/quote:0100beae13]

For future ref.. do you have a non-standard dns setup?
 

Annette

Well-Known Member
PartnerNOC
Aug 12, 2001
445
0
316
Nope. I like to keep things as simple as possible, since it helps weed out miscellaneous possibilities when things like this pop up.
 
B

bdraco

Guest
[quote:f27ddcaee8][i:f27ddcaee8]Originally posted by Annette[/i:f27ddcaee8]

Nope. I like to keep things as simple as possible, since it helps weed out miscellaneous possibilities when things like this pop up.[/quote:f27ddcaee8]

Is it working for you know without the /etc/useoldsubs file ?
 

Annette

Well-Known Member
PartnerNOC
Aug 12, 2001
445
0
316
I've been up to my eyeballs in other issues and haven't checked in with my people who are working the ticket queue, but I'll check that and let you know. If this works, I think it will take the strain off a lot of people and not just us. Thanks.
 

Annette

Well-Known Member
PartnerNOC
Aug 12, 2001
445
0
316
I ran a couple of tests on various servers. On one particular account where subs have been nonfunctional the entire time (and where we have set up subs manually), the adder now says that the sub has been added, but no entry is made in the zone file, and the new sub does not appear in their control panel. Other accounts, both new and old, that did not have a complete failure previously when adding subs (that is, they were able to add at least one sub at some point), work fine. An appropriate entry is made in the zone file and in httpd.conf with the correct IP address and ServerName directive. I'm going to treat the still nonfunctional account as an anomaly at this point, since the rest work as they should.

Good job, and thanks.