Giter Club home page Giter Club logo

ruby-dns's Introduction

Proof of Concept: A DNS Server which can be updated via API.

概念実証:DNSサーバ

概念驗證:可動態更新的DNS Server

Code Climate Issue Count

This Repository hosts a mini DNS Server, powered by Ruby + MySQL.

このリポジトリは、Ruby言語で書かれ、RDBMSによって駆動されるDNSサーバが含まれています。

此存儲庫包含一個使用Ruby編寫及使用RDBMS作爲數據庫的迷你DNS Server。


Requirements // システム必要条件 // 系統要求

  • Ruby >= 2.3.0 w/ Bundler
  • Any RDBMS supported by Sequel ORM
  • Linux (M$ Windows から残念です、申し訳ございません) (不支援 M$ Windows)

How To use? // 使い方 (英語のみ) // 食用方法 (English Only)

  1. Configure your decided RDBMS Driver in Gemfile
  • MySQL should use mysql2
  1. $ bundler update
  2. $ rake config:create
  3. Configure various settings in .env
  4. $ rake db:migrate
  5. $ ruby dnsd.rb
  6. Open a new terminal, $ rackup to run the API Server. Default on port 9292, append -p 1234 to use port 1234

Screenshot

Acknowledgements

Documentations

  • API
    • Basically, send this payload to POST /records/new to create
    {
      "type": "A",
      "name": "hostname",
      "ipv4address": "192.0.2.4",
      "ipv6address": "::FFFF:192.0.2.4"
    }
    • Get all records GET /records
    • Update records PATCH /records/n, where n is record id, No empty records, just leave the field you wanna update
    {
      "name": "hostname",
      "ipv4address": "192.0.2.4",
      "ipv6address": "::FFFF:192.0.2.4"
    }
    • Delete records DELETE /records/n, where n is record id
    • Search by hostname GET /search/name/hostname, where abc is hostname
    • Search by IPv4 GET /search/ip4/192.0.2.4, where 192.0.2.4 is the recorded IPv4 Address
    • Search by IPv6 GET /search/ip6/::FFFF:192.0.2.4, where ::FFFF:192.0.2.4 is the recorded IPv6 Address
  • DNS
    • Normal lookup dig @localhost -p 5300 hostname.yourdesiredzone.local
    • Reverse lookup dig @localhost -p 5300 -x 192.0.2.4 or dig @localhost -p 5300 -x ::FFFF:192.0.2.4
  • Docker
    1. Suggested to use in conjunction with ventz/bind
    1. mysql Docker Container is REQUIRED to power the internal network resolver
    2. docker run command snippet
    3. REST/AMQP API comming soon.

Todo

  • Implement the API via AMQP, but sorry, no documentations will offered on that version because that is intended for

Footnote

  • All Chinese (Traditional Script) and Japanese descriptions in this document are Machine-Translated Results. While Japanese results are interpreted afterwards, quality of Chinese descriptions are not assured.

ruby-dns's People

Contributors

jm1666 avatar

Watchers

 avatar  avatar

ruby-dns's Issues

Docker Deployment

Dittos:

  1. Redeploy after Deployment of DB
  2. Caveats on connecting upstreaming DNS
  • IP Only, which is a bug from RubyDNS Gem

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.