Project

unbound

0.0
No commit activity in last 3 years
No release in over 3 years
Unbound DNS resolver bindings for Ruby
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

Runtime

>= 0
 Project Readme

Synopsis

Ruby FFI bindings for Unbound, a validating, recursive, and caching DNS resolver. Specifically, we are binding to the libunbound API, allowing a for a full Unbound DNS resolver to be embedded within a Ruby application.

These bindings allow for asynchronous and synchronous name resolution. You really should familiarize yourself with libunbound in order to leverage this library. The current bindings will support versions of versions of libunbound distributed with Unbound 1.4.2 or newer.

Code Example

See the examples directory.

Motivation

I needed to resolve millions of DNS queries, and didn't want to spend more than 5 seconds waiting for answers to each question. I had found myself subject to timeouts imposed by my recursive resolver, specifically that these were longer than the 5 seconds.My resolver was only capable of handling so many queries concurrently, so it was very easy to knock it over. I needed a way to cancel queries, freeing resources on my resolver, something that is not possible through the typical UDP DNS interface.

By creating bindings for libunbound, I gained access to the ability to cancel DNS queries (specifically ub_cancel), allowing my name resolution process to move forward at a fair clip.

Installation

You'll need libunbound for Unbound 1.4.2 or greater. This can typically be achieved by installing the 'unbound' DNS package for your distribution.

To install this gem:

gem install unbound

API Reference

Tests

rake spec

Contributors

License

See LICENSE.txt