The Ultimate Guide for Subdomains with NameServes
Posted by: BUGabundo
Posted on: 2007-06-18 02:01:00
The Ultimate Guide for Subdomains with NameServes (and DNS Zones/files) aka subzone
I've seen many people here trying to use subdomains on diferent hosts or even dynamic-ip (like no-ip).
I too have tried many times, until I recently figured out the step that I was missing.
Every new zone (for a top level domain or a subdomain) requires a name server where she SOA is located. Root Name servers only store information of first level domains, for example, DOMAIN.COM. For subdomains, this information is kept on the name servers responsible for the domain SOA zone.
The procedure that I indicate here is only valid for subdomains that use a diferent zone, and not the usual subdomains without a zone file.
So last start. If one has the domain DOMAIN.COM on a server and requires for the subdomain EXE.DOMAIN.com to be on another here whats we need:
For each subdomian we need a NS to handle the SOA file / DNS zone, so it looks like this: NSx.EXE.DOMAIN.com.
This new NS must have the A-Records on the parent domain ( on the DOMAIN.COM zone file ), much similar to the same way that private nameservers are done ( the owner of a domain must ask the registar to make to A-records for the ip of the NS, and then point the domain to them ).
Then on the subdomain zone, one adds the NS for that domain and the A-record ( along with any need MX record, etc ). It is necessary to once again place the NameServers IP as A-records to allow "glue" between the parent zone and this zone.
And thats it.
Now the zone files:
on the parent zone, you have:
NS1.DOMAIN.COM. in SOA admin.DOMAIN.COM
NS1.DOMAIN.COM. A 127.0.0.2 // for glue
NS1.DOMAIN.COM. A 127.0.0.3 // for glue
DOMAIN.COM. NS NS1.DOMAIN.COM.
DOMAIN.COM. NS NS2.DOMAIN.COM.
DOMAIN.COM. A 127.0.0.1
WWW.DOMAIN.COM. CNAME DOMAIN.COM.
DOMAIN.COM. MX 0 127.0.0.1
mail.DOMAIN.COM. MX 0 127.0.0.1
NS1.EXE.DOMAIN.COM. A 127.0.1.2 // for the subdomain
NS1.EXE.DOMAIN.COM. A 127.0.1.3 // for the subdomain
on the subdomain zone, you have:
NS1.EXE.DOMAIN.COM. in SOA admin.DOMAIN.COM
EXE.DOMAIN.COM. NS NS1.DOMAIN.COM.
EXE.DOMAIN.COM. NS NS2.DOMAIN.COM.
EXE.DOMAIN.COM. A 127.0.1.1
WWW.EXE.DOMAIN.COM. CNAME EXE.DOMAIN.COM.
DOMAIN.COM. MX 0 127.0.1.1
mail.DOMAIN.COM. MX 0 127.0.1.1
NS1.EXE.DOMAIN.COM. A 127.0.1.2 // for glue
NS1.EXE.DOMAIN.COM. A 127.0.1.3 // for glue