Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tomdionysus/dns-server
A DNS Server in NodeJS (Demo for network-serializer)
https://github.com/tomdionysus/dns-server
Last synced: about 2 months ago
JSON representation
A DNS Server in NodeJS (Demo for network-serializer)
- Host: GitHub
- URL: https://github.com/tomdionysus/dns-server
- Owner: tomdionysus
- Created: 2020-05-11T08:06:57.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2024-07-09T01:45:23.000Z (6 months ago)
- Last Synced: 2024-07-09T05:13:02.224Z (6 months ago)
- Language: JavaScript
- Size: 148 KB
- Stars: 1
- Watchers: 3
- Forks: 1
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# dns-server
[![Build Status](https://travis-ci.org/tomdionysus/dns-server.svg?branch=master)](https://travis-ci.org/tomdionysus/dns-server)
[![Coverage Status](https://coveralls.io/repos/github/tomdionysus/dns-server/badge.svg?branch=master)](https://coveralls.io/github/tomdionysus/dns-server?branch=master)
[![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)A Demo DNS Server project in NodeJS, to demonstrate [network-serializer](https://github.com/tomdionysus/network-serializer).
**Note** This is a technology demo project, DO NOT use it as a DNS server.
## Installation
```bash
npm install
```In addition, you will need an accessible MySQL/MariaDB database, initialised from the schema in [db_setup.sql](sql/db_setup.sql):
```bash
export DATABASE_NAME="dnsserver"
mysql -u root --execute="CREATE DATABASE $DATABASE_NAME;"
mysql -u root $DATABASE_NAME < sql/db_setup.sql
```## Running
The server needs a `DB_URI` in the following format, and will bind to UDP Port 53 by default. MacOS and various other OSes bind `0.0.0.0` UDP Port 53, so it's best to run it on a different one.
```bash
DB_URI=mysql://root@localhost/$DATABASE_NAME LOG_LEVEL=DEBUG PORT=54 node index.js
```## Demo
```bash
dig @localhost -p 54 example.com +noedns
```