Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rtpa25/dns-server
A fully functional prototype DNS server built with NodeJS and Typescript
https://github.com/rtpa25/dns-server
dns nodejs typescript
Last synced: about 1 month ago
JSON representation
A fully functional prototype DNS server built with NodeJS and Typescript
- Host: GitHub
- URL: https://github.com/rtpa25/dns-server
- Owner: rtpa25
- Created: 2024-06-17T11:17:57.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2024-09-05T07:27:00.000Z (4 months ago)
- Last Synced: 2024-10-17T00:57:37.688Z (3 months ago)
- Topics: dns, nodejs, typescript
- Language: TypeScript
- Homepage:
- Size: 166 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.MD
Awesome Lists containing this project
README
# Custom DNS Server
This project is a fully functional DNS server built from scratch, featuring an HTTP client interface for querying specific domains and record types. The server includes custom logic for parsing and building UDP packets and can recursively resolve any domain of your choice.
## Features
- Custom UDP packet parsing and building
- Recursive DNS resolution
- HTTP client interface for user queries
- Support for various DNS record types## Getting Started
### Installation
1. Clone the repository:
```sh
git clone https://github.com/yourusername/custom-dns-server.git
cd custom-dns-server
```2. Install dependencies:
```sh
pnpm install
```3. Copy the example environment variables file and set your own values:
```sh
cp .env.example .env
```4. Setup your free redis at [upstash](https://console.upstash.com/redis/)
### Running the Server
To start the DNS server in dev, run:
```sh
pnpm dev
```This will start both the UDP server for DNS queries and the HTTP server for user interactions.
### Running Tests
To execute the test suite, run:
```sh
pnpm test
```## Usage
### HTTP API
The HTTP server provides endpoints for querying DNS records. Here is an example of how to use it:
```sh
curl -X GET "http://localhost:8080/resolve?domain=www.ronit.dev&type=A"
```This will return the A record for `example.com`.