Skip to content

suitux/fluent-dns

Repository files navigation

Fluent DNS UI Logo

Fluent DNS is a javascript based DNS that simplifies the work of mounting a DNS server using the library dns2 and reduces it to a npm start.

The functionality it's basic. It's a DNS that actuates like /etc/hosts file. (c:\Windows\System32\Drivers\etc\hosts. on windows)

First, the DNS will search in his ./shared/db/dns-entries.json entries. If the entry is not found, it will search it on a real DNS (8.8.8.8) and will resolve it.

Installation

Download this repository.

git clone https://github.com/suitux/fluent-dns

Usage

  1. Modify ./shared/db/dns-entries.json with your DNS entries.
  2. Start with:
npm start

dns-entries.json structure

[
    {
        "id": "0416a1f04f6e25976dc75875715d85fd60c048e5",
        "name": "web.dev",
        "address": "192.168.1.148",
        "ttl": 60,
        "type": 1,
        "class": 1
    }
]

Entry types

Class types

DNS API Endpoints

  • GET /v1/entries
  • POST /v1/entries:
{
    "name": "google.es",
    "address": "192.168.1.148",
    "ttl": 60,
    "type": 1,
    "class": 1
}
  • PATCH /v1/entries:
{
    "id": "675asd567ad56sa",
    "data": {
        "name": "google.es",
        "address": "192.168.1.148",
        "ttl": 60,
        "type": 1,
        "class": 1
    }
}
  • DELETE /v1/entries:
{
       "id": "675asd567ad56sa"
}

Test

npm test

Known problems

Command line doesn't show 'DNS Server started.':

There is a service running on port *.53 on your local machine. You should stop it to run the DNS Server.

Look for local services running on port *.53:

lsof -i udp:53

When you find it, kill it using the following command:

kill [PID]

Contributing

Pull requests are welcome :)

Please make sure to update tests as appropriate.

License

MIT

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published