Creating a DNS server with node.js to programatically "fake" domain nameservers for subdomains

3,221 views
Skip to first unread message

Tom

unread,
Dec 16, 2010, 1:26:20 PM12/16/10
to nod...@googlegroups.com
Hi there,

Note: these 4 paragraphs explain my situation, you could skip them if you wish.

I'll first introduce my situation. I'm running a free service where people can register subdomains. At the moment, these aren't actual subdomains as every "subdomain" is simply a (wildcard) redirect to the top domain, which then looks up the subdomain entered and loads the content corresponding to the entered subdomain (with a database). The subdomain than fakes to be a website by showing a full size iframe which cloaks a URL entered by the person who registered the subdomain.

Of course, this kind of "domain" is quite unprofessional, which explains why I have gotten a whole lot of requests to allow users to actually set their server's nameservers for a subdomain. This way, the free subdomain would function like a normal domain.

After researching for a bit, this actually seems to be technically possible: http://zytrax.com/books/dns/ch9/delegate.html

I must admit that my current knowledge about DNS is nothing special, but I would like to learn. Also, since my service is free, there is no financial gain which is another reason why I have to implement this myself.

Note: these paragraphs explain my actual needs

In order to facilitate such service, I have decided to get myself some linode (a cloud service) servers. While they do allow a DNS API, this obviousely is not meant to be used for thousands of subdomains.

After asking on the linode forums, I have been told that
1) I need to create my own DNS server (I want to use Node.js for this)
2) I need to be able to create these DNS settings in a database, rather than modifying some files all the time (this makes sense since I want to be able to allow a lot of subdomains)

(I have gotten these answers from http://linode.com/forums/viewtopic.php?t=6385, but no actual suggestions were given there other than the two points above).

Now, my questions are:
1) What should I read to understand the concept of the system that I need to create for this service?
2) How can I implement such DNS system with node.js?
3) Have there been any similar attempts in the past?
4) Is anyone else interested in such project?

To conclude, the final objective is to create a service where users can create a subdomain and make this subdomain point to their own nameservers, so that they function like top level domains.

Thanks in advance.

Best regards,
Tom

Andrew Lunny

unread,
Dec 16, 2010, 1:48:43 PM12/16/10
to nod...@googlegroups.com
In answer to #3, Tom Hughes-Croucher worked on a Node-based DNS server a while back
--
You received this message because you are subscribed to the Google Groups "nodejs" group.
To post to this group, send email to nod...@googlegroups.com.
To unsubscribe from this group, send email to nodejs+un...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/nodejs?hl=en.



--
Andrew Lunny
Software Developer, Nitobi
604 685 9287
blogs.nitobi.com/andrew

Terry Riegel

unread,
Dec 16, 2010, 2:14:30 PM12/16/10
to nod...@googlegroups.com
> To conclude, the final objective is to create a service where users can create a subdomain and make this subdomain point to their own nameservers, so that they function like top level domains.


If you had to do this manually what would it look like? I am familiar with tinydns and bind so I am curious what this would look like if done manually.


Terry Riegel

Scott Elcomb

unread,
Dec 16, 2010, 1:47:36 PM12/16/10
to nod...@googlegroups.com
On Thu, Dec 16, 2010 at 1:26 PM, Tom <tomm...@gmail.com> wrote:
> Now, my questions are:
> 1) What should I read to understand the concept of the system that I need to
> create for this service?
> 2) How can I implement such DNS system with node.js?
> 3) Have there been any similar attempts in the past?
> 4) Is anyone else interested in such project?

Not sure how useful this is (or if node has an equivalent) but Perl
has a set of modules for working with DNS. The documentation and
source can be found at CPAN:
<http://search.cpan.org/~olaf/Net-DNS-0.66/>

If I were going to approach this (rather interesting project) I'd
probably start by looking to implement Net::DNS functionality.

All the best,
- Scott.


--
  Scott Elcomb
  http://www.psema4.com/   @psema4

  Member of the Pirate Party of Canada
  http://www.pirateparty.ca/

Reply all
Reply to author
Forward
0 new messages