CNAME a domain and delegate the subdomain
August 29, 2008 1:33 PM
Subscribe
Can I CNAME a second-level domain, and delegate a subdomain to a nameserver? What if the nameserver is the same for both?
So here's my problem: I have a page at example.freehost.com, and I want to:
1) Buy domain example.com and forward (www.)example.com to example.freehost.com via CNAME.
2) Buy hosting for a subpart of the site (say, forum.example.com), in a host that uses cPanel (which means I should be able to delegate NS for forum.example.com to them).
The added complication is that I want to buy the domain and the hosting from the same company, which means the nameserver for forum.example.com could end up being the same as the one for example.com
So, in summary I want to have entries like these:
example.com CNAME example.freehost.com
www.example.com CNAME example.freehost.com
forum.example.com NS 1.1.1.1
forum.example.com NS 1.1.1.2
And on 1.1.1.1 & 1.1.1.2, the normal cpanel entries...
forum.example.com A [myhostsip]
forum.example.com MX [myhostsip]
blah blah blah etc etc.
My first question is - Is that a valid configuration (cnaming the second-level and delegating the third level)
My second question is: can I have both entries in 1.1.1.1 & 1.1.1.2 (that is, have the NS entry be a self-reference)?
Or will this self-reference make the internets asplode?
Also, if I can, will I be able to do it by just managing my DNS entries, and asking the hosting guys to put forum.example.com on cPanel, or will this require some black magic in part of the hosts? (which means they probably won't do, since I'm aiming for a cheap host)
posted by qvantamon to computers & internet (9 comments total)
2 users marked this as a favorite
Assuming the third line is a host entry (eg there really is a "forum.example.com" machine out there somewhere) that's invalid. NS entries are valid only at the domain level.
Now, there is sort of a way to do what you're trying to do. On 1.1.1.1, have this:
example.com CNAME example.freehost.com
www.example.com CNAME example.freehost.com
forum.example.com A your.ip.address.here
forum.example.com MX your.smtp.address.here
Then set your nameserver to be a secondary of 1.1.1.1 for example.com, but have it listed as the primary nameserver in your whois entry. That gives the illusion of your nameserver being authoritative without you actually managing the domain on that machine.
posted by mark242 at 1:57 PM on August 29, 2008