Web Hosting Talk







View Full Version : DNS for subdomains


GordonH
12-31-2000, 07:16 AM
Hello
This question assumes I am doing all the DNS manually and that the domain in question is not the one associated with the server (i.e. not the automatic Alabanza system).

Suppose I own domain.com and have it on my name servers.
I want to give a customer theirname.domain.com

I can go into the DNS records for domain.com and set up an A record to point to their sites IP address, but how do I delegate the DNS so they have their own zone file with an MX record so they can receive e-mail at that subdomain?

I could set up a zone file for theirname.domain.com but that would need to be tied to the record for domain.com.

How do you do that?

The reason for the question is that I own a few good generic word domain names that people often express interest in getting subdomains off and I thought I could give away these subdomains as a marketing ploy.
People could just select a domain from a drop down box on the hosting order form and type in their chosen subdomain.

I know there are ways of doing it with wildcards etc, but I need to do it properly with full DNS.

Any ideas?

Gordon

webfors
12-31-2000, 09:19 AM
Hi Gordon,

Well, for subdomains I just set up a seperate zone file and then add the appropriate httpd.conf entry for it. For example here is a zone file for one of my subdomains:

@ 14400 IN SOA ns1.wwkiosk.com. root.ns1.wwkiosk.com. (
977102706 ; serial, todays date+todays
28800 ; refresh, seconds
7200 ; retry, seconds
3600000 ; expire, seconds
86400 ) ; minimum, seconds

joel.wwkiosk.com. 14400 IN NS ns1.wwkiosk.com.
joel.wwkiosk.com. 14400 IN NS ns2.wwkiosk.com.
joel.wwkiosk.com. 14400 IN A 216.74.85.251

localhost.joel.wwkiosk.com. 14400 IN A 127.0.0.1

joel.wwkiosk.com. 14400 IN MX 0 joel.wwkiosk.com.

mail 14400 IN CNAME joel.wwkiosk.com.
www 14400 IN CNAME joel.wwkiosk.com.
ftp 14400 IN CNAME joel.wwkiosk.com.

It's identical to a zone file for any fully qualified domain. I'm not sure what you mean "I could set up a zone file for theirname.domain.com but that would need to be tied to the record for domain.com." As far as I know the subdomain does not have to be "tied" to anything. It functions just like a fully qualified domain.

GordonH
12-31-2000, 09:44 AM
Hi
Thats very helpful.
I will go and set one up and see what happens.

I just don't understand how the name resolves if its not on the root servers.

If you can just set up zone files for anything you could make up your own tld's.
I assume it only works because .com is a recgnised tld.

Hell, I could do a uk.com and set up my own alternative TLD!

.....only kidding/

Gordon

webfors
12-31-2000, 09:49 AM
ohh, do you mean the root domain ie: domain.com is not setup on the same server?? If that's the case then just setting up a zone file won't work. The fully qualified domain name must resolve to the same server in order to set up a subdomain the way I mentioned.

GordonH
12-31-2000, 09:58 AM
Yes
I just found that out for myself!

I tried to set one up for a domain that wasn't on the same name server and it didn't work.
So I have set one up for a domain I do have the DNS for and it appears to be OK.

I will just wait for the info to circulate and test it out.

Thanks for your help.

Gordon