DNSmasq with an api to register names and IP's
1.2K
DNSmasq with an api to register names and IP's
docker run -it -p 80:80 -p 53:53/udp -v /my/local/path/for/dns/hosts/file:/etc/dnsmasq/hosts ibmurai/dns
To update or add an IP:
POST /
{
"ip" : "ip-address",
"name" : "fqdn",
"id" : "some-uniqueness-identifier"
}
Example cURL command for updating or adding:
curl -XPOST -H 'Content-Type: application/json' http://127.0.0.1/ -d '{"name":"destruct0r.roebotz.org","ip":"192.168.12.42","id":"some-uniqueness-identifier"}'
You will get an HTTP/201 when adding a new id, HTTP/200 when updating an existing id, HTTP/400 if something's not right with the input and HTTP/409 if trying to register a name which already exists with a different id.
To get a list of all host/ip pairs the DNS knows:
GET /
Content type
Image
Digest
Size
7 MB
Last updated
over 7 years ago
docker pull ibmurai/dns