HackerDNS is a DNS server written in node.js, current repository is a complete bockend for it, consisting of both DNS and API servers.
config-sample.json
to config.json
and change configurationnode app.js # to run both dns and api server
node app.js api # to run only api server
node app.js dns # to run only dns server
POST /signup { "email": "[email protected]", "password": "password" }
Returns:
{ "ok": true, "token": "your-auth-token" }
Requests to all other API methods will require either token
in body, or in
http header X-HackerDNS-Token
(case-insensitive). Therefore token
field in
body in all methods below is optional, if present in headers.
POST /logout { "token": "your-auth-token" }
Returns:
{ "ok": true }
GET /dns
Returns:
[ {
"domain": "example.com",
"records": [{
"sub": "sub.domain",
"type": "A",
"data": "1.2.3.4",
"ttl": 9000
},
...
]
},
...
]
GET /dns/:domain
Returns - same as above, but one object (not array).
POST /dns
{
"token": "...",
"domain": "example.com",
"records": [{ /* format as above */ }]
}
Returns
{ "ok": true }
POST /dns
{
"token": "...",
"domain": "example.com",
"records": [{ /* format as above */ }]
}
Returns
{ "ok": true }
This software is licensed under the MIT License.
Copyright Fedor Indutny, 2013.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.