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.
Download this repository.
git clone https://github.com/suitux/fluent-dns
- Modify
./shared/db/dns-entries.json
with your DNS entries. - Start with:
npm start
[
{
"id": "0416a1f04f6e25976dc75875715d85fd60c048e5",
"name": "web.dev",
"address": "192.168.1.148",
"ttl": 60,
"type": 1,
"class": 1
}
]
- 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"
}
npm test
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]
Pull requests are welcome :)
Please make sure to update tests as appropriate.