Coder Social home page Coder Social logo

celluloid-dns's Introduction

Celluloid::DNS

Gem Version Build Status Dependency Status Code Climate Coverage Status

Celluloid::DNS is a programmable Celluloid "cell" for answering DNS requests. It's implemented using Celluloid::IO and is great for programatic DNS servers which dynamically generate DNS responses, particularly within Celluloid-based programs.

A nonblocking DNS client is already built into Celluloid::IO itself. Celluloid::DNS is just for servers.

Installation

Add this line to your application's Gemfile:

gem 'celluloid-dns'

And then execute:

$ bundle

Or install it yourself as:

$ gem install celluloid-dns

Inside of your Ruby project, use:

require 'celluloid/dns'

...to pull Celluloid::DNS in as a dependency.

Usage

Start a DNS server that always resolves to 127.0.0.1:

require "celluloid/dns"

Celluloid::DNS::Server.new("127.0.0.1", 1234) do |request|
  request.answer request.questions.map { |q| [q, "127.0.0.1"] }
end

sleep

Query the server:

$ dig @localhost -p 1234 anything.com

Contributing to Celluloid::DNS

  • Fork this repository on github
  • Make your changes and send me a pull request
  • If I like them I'll merge them
  • If I've accepted a patch, feel free to ask for commit access

License

Copyright (c) 2012 Tony Arcieri. Distributed under the MIT License. See LICENSE.txt for further details.

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.