Linode Forum
https://forum.linode.com/

Programatically create subdomains with their own nameservers
https://forum.linode.com/viewtopic.php?f=19&t=6385
Page 1 of 3

Author:  tommedema [ Sat Dec 11, 2010 5:27 pm ]
Post subject:  Programatically create subdomains with their own nameservers

Hi there,

I'm trying to setup a little service where people can register a subdomain and use it for their server by setting the corresponding nameservers of this server.

I'm wondering, how can I programatically create these subdomains with their own nameservers in an efficient way? Such that it'd be possible to have eg. a million of these subdomains?

Any advice is appreciated.

Thanks.

- Tom

Author:  hoopycat [ Sat Dec 11, 2010 10:56 pm ]
Post subject: 

For a good look at how DNS works and some of the tricks you can (and cannot) use, especially in large-scale situations like this, you'll probably want http://oreilly.com/catalog/9780596100575 at the ready.

I haven't personally used it in awhile, but take a look at PowerDNS. It has been around awhile, and supports a number of databases on the back end, SQL and otherwise.

Author:  jebblue [ Sun Dec 12, 2010 2:06 pm ]
Post subject: 

hoopycat if you ask people to not redact their host name when posting, you are asking them to not post it. Is that what you intended?

tr.v., -dact·ed, -dact·ing, -dacts.

1. To draw up or frame (a proclamation, for example).
2. To make ready for publication; edit or revise.

Author:  pclissold [ Sun Dec 12, 2010 3:28 pm ]
Post subject: 

Merriam-Webster says:
Definition of REDACT
transitive verb
  1. to put in writing : frame
  2. to select or adapt (as by obscuring or removing sensitive information) for publication or release; broadly : edit
  3. to obscure or remove (text) from a document prior to publication or release

Author:  hoopycat [ Mon Dec 13, 2010 12:21 am ]
Post subject: 

Peter's 3rd definition is the one I'm using. Get a better dictionary :-)

Author:  tommedema [ Mon Dec 13, 2010 12:56 pm ]
Post subject: 

hoopycat wrote:
For a good look at how DNS works and some of the tricks you can (and cannot) use, especially in large-scale situations like this, you'll probably want http://oreilly.com/catalog/9780596100575 at the ready.

I haven't personally used it in awhile, but take a look at PowerDNS. It has been around awhile, and supports a number of databases on the back end, SQL and otherwise.


Hi HoopyCat,

Thanks for your literature suggestion.

Before I order this book, I would like to know if managing DNS like this is possible with Linode (in an efficient enough way to create a whole lot of subdomains with their own nameservers).

- Tom

Author:  bryantrv [ Mon Dec 13, 2010 2:21 pm ]
Post subject: 

I would bet you would have to run your own name server to do what you want, rather than using the Linode ones.
It certainly should be possible, though.

Author:  tommedema [ Mon Dec 13, 2010 2:56 pm ]
Post subject: 

bryantrv wrote:
I would bet you would have to run your own name server to do what you want, rather than using the Linode ones.
It certainly should be possible, though.


Apologies if this makes no sense, but can I run my own dns server on a linode server?

Thanks.

Author:  Guspaz [ Mon Dec 13, 2010 3:26 pm ]
Post subject: 

tommedema wrote:
bryantrv wrote:
I would bet you would have to run your own name server to do what you want, rather than using the Linode ones.
It certainly should be possible, though.


Apologies if this makes no sense, but can I run my own dns server on a linode server?

Thanks.


A linode can do anything that any other server can do, so yes, you can.

Are you sure you need to, though? I'm not entirely clear on what you're trying to do. You want to create subdomains and use *those* as name servers for customer domains? Is there a reason you can't use Linode's name servers?

Or do you just want to create subdomains for the websites themselves, and want to automatically create the subdomains for customers to access their webpages? You can do that with Linode's name servers through the API, I believe.

Author:  tommedema [ Mon Dec 13, 2010 3:32 pm ]
Post subject: 

Guspaz wrote:
tommedema wrote:
bryantrv wrote:
I would bet you would have to run your own name server to do what you want, rather than using the Linode ones.
It certainly should be possible, though.


Apologies if this makes no sense, but can I run my own dns server on a linode server?

Thanks.


A linode can do anything that any other server can do, so yes, you can.

Are you sure you need to, though? I'm not entirely clear on what you're trying to do. You want to create subdomains and use *those* as name servers for customer domains? Is there a reason you can't use Linode's name servers?

Or do you just want to create subdomains for the websites themselves, and want to automatically create the subdomains for customers to access their webpages? You can do that with Linode's name servers through the API, I believe.


Hi again,

I'm not trying to do either of those.

Basically, I want to allow other people to create a subdomain and then setup their own nameservers (aka the nameservers of their servers, not mine) for the subdomains that they created.

Thus, a subdomain would function like a top level domain, where the registrant can setup his nameservers so that the domain will lead to the corresponding servers.

Author:  Guspaz [ Mon Dec 13, 2010 5:28 pm ]
Post subject: 

But... You can't have a name server for a subdomain...

You just want your clients to be able to create a subdomain under your domain, and point it to their own IP? That's trivial, should be able to do it with the API. You just need to add A-record CRUD support to your application for linode's DNS services.

Author:  tommedema [ Mon Dec 13, 2010 5:52 pm ]
Post subject: 

Guspaz wrote:
But... You can't have a name server for a subdomain...

You just want your clients to be able to create a subdomain under your domain, and point it to their own IP? That's trivial, should be able to do it with the API. You just need to add A-record CRUD support to your application for linode's DNS services.


I realize that.

However, do you really think the linode DNS API is meant for bulk records? I want this to be setup correctly, so that it can (hypothetically) expand to hundred of thousands of subdomains with their own IPs.

Author:  Stever [ Mon Dec 13, 2010 5:58 pm ]
Post subject: 

Guspaz wrote:
But... You can't have a name server for a subdomain...

Ummm.... why not?

Not that it is necessarily a good idea, but AFAIK it can be done.

Author:  bryantrv [ Mon Dec 13, 2010 6:07 pm ]
Post subject: 

A side note- I'm not sure you could buy hundreds of thousand of IP addresses, and I'm near certain you couldn't in any single Linode data center.
I really cannot thing of a legit reason to need that many.

Author:  Guspaz [ Mon Dec 13, 2010 6:11 pm ]
Post subject: 

Stever wrote:
Guspaz wrote:
But... You can't have a name server for a subdomain...

Ummm.... why not?

Not that it is necessarily a good idea, but AFAIK it can be done.


Hmm, didn't realize you can do that. But it's strictly a redirect; the root server is still going to point to your name server, and only when the client queries your name server will it find out that it has to query yet another name server to get info on the subdomain.

tommedema wrote:
I realize that.

However, do you really think the linode DNS API is meant for bulk records? I want this to be setup correctly, so that it can (hypothetically) expand to hundred of thousands of subdomains with their own IPs.


Well, since Linode won't give you hundreds of thousands of IPs, they might not be happy that you're using their DNS servers to host hundreds of thousands of non-linode IPs...

You should ask them directly.

EDIT: More to the point, I'm not sure anybody is going to give you hundreds of thousands of IPs, not with IPv4 exhaustion 71 days away.

Page 1 of 3 All times are UTC-04:00
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/