44
votes

Does anybody know of a DNS Server that is written in Node.JS? I am specifically interested in Authoritative DNS Servers (as opposed to caching DNS server).

The only thing this needs to do is to serve A, MX, TXT, SPF, SOA, NS records based on my own algorithm which I will write into a fork or clone of whatever I find to start with.

In fact I may not need all of those types of records. But the important thing is that it must work. I do not want to have DNS debugging issues. I am hoping (expecting) this will not be a problem because DNS is very simple (I have heard).

Is there anything in Node.JS I can start with? If you know that something has been used in production, then please let me know.


The Node.JS DNS Servers I have found are

If anyone is using one for production, I would like to know. So far they seem to be very scattered efforts.

6
(Why) must it be written in Node? DNS is just DNS.Matt Ball
@Matt: It does not need to be written in Node.JS, but I am very impressed about the qualities of that language and would like to use it for DNS as well as the other components of this software model. I would also be OK with Java if I had something simple to start with. I do not have a mind to include a bloated library in my code. I am impressed by how easy it is to program in Node.JS, also am impressed because more of the code out there has not had chance to move on from the "simple" stage.700 Software
Should you decide to give up on ndns and Node.js, look for my "evldns" on Google Code.Alnitak
you might want to read the code anyway - it's an event driven DNS server that may help answer some of your other questions.Alnitak
Twisted Names might be easier to read than C and is also an event driven authoritative name server twistedmatrix.com/trac/browser/trunk/twisted/namesMichael Dillon

6 Answers

12
votes

Here's "a very basic authority server built with Node.js", in < 500 lines: dnsserver.js

4
votes

After reviewing all available node.js DNS libraries, i found DNS2 to be one of the best available library in 2020 which is still maintained.

Some of its features:

  • Implementation in Pure JavaScript with no dependencies
  • Server and Client
  • Lot of Type Supported
  • Extremely lightweight
  • DNS over UDP, TCP, HTTPS Supported

https://github.com/song940/node-dns

npm install dns2
3
votes

I found a DNS server write in node.js fun_dns the source is on github

2
votes

bns: DNS library, server, and validating recursive resolver for node.js, in pure javascript.

1
votes

Since Java is okay for you, you could have a look at the Eagle DNS project. It is written in Java and supports both MySQL and file based stores for the records, and allow you to write your own module if that doesn't fit your needs: http://www.unlogic.se/projects/eagledns