Code Monkey home page Code Monkey logo

flex-dns's Introduction

Flex DNS

A simple flexible DNS server with REST API.

Features

  • Add, update, delete A Record through REST API.
  • Fast DNS server

Requirement

  • Docker
  • Docker Compose

Usage

Startup

> git clone https://github.com/HeRoMo/flex-dns.git
> cd flex-dns
> docker-compose build
> docker-compose up

Add A Record and resolve address

> docker-compose up -d
> curl -X POST \
  http://localhost:4567/host \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  -d 'name=hoge.sample.com&address=192.168.1.111'
{"result":"ok"}
> dig @localhost -p 2346 hoge.sample.com

; <<>> DiG 9.10.6 <<>> @localhost -p 2346 hoge.sample.com
; (2 servers found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 13705
;; flags: qr aa rd; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0
;; WARNING: recursion requested but not available

;; QUESTION SECTION:
;hoge.sample.com.               IN      A

;; ANSWER SECTION:
hoge.sample.com.        86400   IN      A       192.168.1.111

;; Query time: 4 msec
;; SERVER: ::1#2346(::1)
;; WHEN: Tue Mar 10 21:45:08 JST 2020
;; MSG SIZE  rcvd: 49

REST API

POST /host

Add or update an A Record.

params:

  • name hostname
  • address IPv4 address

response:

  • {"result": "ok"} success
  • {"result": "ng"} fail

GET /list

Get all records.

DELETE /host

Delete an A Record.

LICENSE

MIT

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.