create subdomains on the fly in a Java web app

D

Dundonald

Has anyone developed a web app that creates subdomain names on the
fly? For example a users of our web service can create a subdomain on
our main domain name, such as customersusername.ourdomainname.com?

I'm just wondering how this could be done.

Thanks
 
G

Greg R. Broderick

Has anyone developed a web app that creates subdomain names on the
fly? For example a users of our web service can create a subdomain on
our main domain name, such as customersusername.ourdomainname.com?

I'm just wondering how this could be done.

c.f. the O'Reilly "cricket" book on DNS for the gory technical details,
<http://www.oreilly.com/catalog/dns5/>.


With the reference implementation of DNS (BIND), you would need to:

1. If the 'subdomain' points at a single host, modify the zone file for the
master domain, by adding a new A or A6 (if you're using IPv6) record for the
new subdomain. Modify the zone file for the reverse zone to point the host's
IP address at the newly-created host name.

or

1. If the subdomain may contain more than one host, create a new zone file
for the new subdomain. This can probably be templated, using a tool such as
velocity.

2. Modify the zone serial number in the SOA record of the second-level
domain. This tells the DNS server that the zone data has changed.

3. If the subdomain required the creation of a new zone file for the
subdomain, modify the file /etc/named.conf to point the new zone at the new
zone files.

4. Forcibly restart the name server.

Much of this would be considerably easier if the name server is itself open-
source and implemented in java, but in any case, a thorough grounding in the
domain naming system will be essential if you wish to accomplish this task.

Cheers!
GRB


--
---------------------------------------------------------------------
Greg R. Broderick (e-mail address removed)

A. Top posters.
Q. What is the most annoying thing on Usenet?
---------------------------------------------------------------------
 
D

Dundonald

c.f. the O'Reilly "cricket" book on DNS for the gory technical details,
<http://www.oreilly.com/catalog/dns5/>.

With the reference implementation of DNS (BIND), you would need to:

1. If the 'subdomain' points at a single host, modify the zone file for the
master domain, by adding a new A or A6 (if you're using IPv6) record for the
new subdomain. Modify the zone file for the reverse zone to point the host's
IP address at the newly-created host name.

or

1. If the subdomain may contain more than one host, create a new zone file
for the new subdomain. This can probably be templated, using a tool such as
velocity.

2. Modify the zone serial number in the SOA record of the second-level
domain. This tells the DNS server that the zone data has changed.

3. If the subdomain required the creation of a new zone file for the
subdomain, modify the file /etc/named.conf to point the new zone at the new
zone files.

4. Forcibly restart the name server.

Much of this would be considerably easier if the name server is itself open-
source and implemented in java, but in any case, a thorough grounding in the
domain naming system will be essential if you wish to accomplish this task.

Cheers!
GRB

--
---------------------------------------------------------------------
Greg R. Broderick (e-mail address removed)

A. Top posters.
Q. What is the most annoying thing on Usenet?
---------------------------------------------------------------------

Hey Greg thanks for your post and the info. I'm currently
transferring my service to a new host so I'm going to take a look at
the above and how I can programmatically automate this process, if at
all possible.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,566
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top