https://github.com/tomdionysus/dns-server
A DNS Server in NodeJS (Demo for network-serializer)
https://github.com/tomdionysus/dns-server
Last synced: 16 days 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 (about 5 years ago)
- Default Branch: master
- Last Pushed: 2024-07-09T01:45:23.000Z (about 1 year ago)
- Last Synced: 2025-06-04T13:45:11.625Z (about 1 month ago)
- Language: JavaScript
- Size: 148 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# dns-server
[](https://travis-ci.org/tomdionysus/dns-server)
[](https://coveralls.io/github/tomdionysus/dns-server?branch=master)
[](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
```