Project

splicer

0.0
Repository is archived
No commit activity in last 3 years
No release in over 3 years
Splicer allows communication with one or more dns providers
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 1.3.0, ~> 1.3
>= 10.4.0, ~> 10.4
>= 3.4.0, ~> 3.4.0
 Project Readme

Splicer

Code Climate

Allows for interactions with multiple DNS' through one abstract API. You can use this to talk to one or more DNS providers if you choose.

splice: join or connect (a rope or ropes) by interweaving the strands.

You are joining multiple DNS providers together. This can be used to transfer records from one to the other without breaking the primary provider.

Installation

Add this line to your application's Gemfile:

gem 'splicer'

Configuring

Splicer.configure do |config|
  config.register(Splicer::Dynect::Config.new('company','user','pass')) # gem 'splicer-dynect'
  config.register(Splicer::DNSMadeEasy::Config.new('user','pass')) # gem 'splicer-dns_made_easy'
end

This library does rely on 3rd party sources, so it can and will take time to publish the zones. It would be wise to put this into a background job.

Under The Hood

Splicer is a simple abstract data structure that allows you to put together DNS zones and records quickly. The providers are what take this abstract DNS model and turn it into the concrete model in some external API.

Records

All records are relative to a zone.

record = Splicer::Records::ARecord('example.com', '127.0.0.1')

Zones

Is a collection of records.

zone = Splicer::Zone.new('example.com')
zone.add_record(record)
zone.publish(:merge)

When Splicer::Zone#publish is called, the provider can be passed to only push the updates to that zone in the DNS.

Provider

Providers are adapters to a 3rd party API, such as Dynect or DNSMadeEasy. Both API's are very different but similar in many respects.

If you write a provider you MUST follow a few rules:

  • A provider must utilize the abstract model.
  • Do NOT monkey patch the abstract model. This can cause problems with other provider gems, and cause the library to be unstable.
  • Provide a way to build an abstract model from the concrete (3rd party) model. This will allow for easier export to other DNS providers.
  • If a provider does not have an ability to use/create a record such as a KEY record, then ignore it.
  • When publishing the zone, there should be ways to completely overwrite the zone and merge existing records with that zone.
  • Tests must be written.

Contributions

Any and all contributions are welcome. Be sure to create a feature branch and send pull requests. Always, always, run rspec spec or rake to ensure that all tests are passing.

Note:

As of version 2.2.0, Dynect will no longer be fully supported.