Skip to content

Lab21k/dns-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Dynamic nameserver

You can add entries via a HTTP endpoint.

Running

  1. Run the server as root:
sudo node server.js
  1. Add the nameserver to resolv.conf as the primary nameserver
vim /etc/resolv.conf
  1. 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"}'
  1. Test it:
ping raspberry-pi-123

Should output:

PING raspberry-pi-123 (172.30.0.4) 56(84) bytes of data.
...