You can add entries via a HTTP endpoint.
- Run the server as root:
sudo node server.js
- Add the nameserver to resolv.conf as the primary nameserver
vim /etc/resolv.conf
- To add new entries, make a POST request with the IP and the "serial" as json body:
curl -X POST -H 'Content-Type: application/json' -d '{"ip": 172.30.0.4, "serial": "raspberry-pi-123"}'
- Test it:
ping raspberry-pi-123
Should output:
PING raspberry-pi-123 (172.30.0.4) 56(84) bytes of data.
...