Skip to content
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

RadioDNS Ruby Library


This Ruby Gem provides utilities for working with RadioDNS. It supports service CNAME resolution from bearer parameters and application discovery, corresponding to v0.6.1 of the RadioDNS spec.


gem install radiodns


Add this to the top of your script

require 'radiodns'

Then if you already have the Fully Qualified Domain Name as specified in the RadioDNS spec, you can resolve it into a CNAME like so

service = RadioDNS::Resolver.resolve('')
puts service.cname #=> ''

You can also pass in the parameters required to construct the FQDN to the resolve method

params = {
  :freq => '09580',
  :pi => 'c586',
  :ecc => 'ce1',
  :bearer => 'fm'
service = RadioDNS::Resolver.resolve(params)

The bearers fm, dab, drm, amss and hd are supported.

Once you have a service you can perform application discovery

radiovis_application = service.radiovis #=> ""
radiovis_application.port #=> 61613
radiovis_application.type #=> :radiovis

Or to get an array of supported applications


which returns

[#<RadioDNS::Application @host="", @port=61613, @type=:radioepg>,
 #<RadioDNS::Application @host="", @port=61613, @type=:radiovis>]

In the future these may become instances of specific classes that implement application-specific behaviour, but I might make those separate gems.


  • better error checking of supplied parameters. The code current checks for mandatory parameters but not if the parameters themselves conform to the spec (e.g. pa should be between 0 and 1023)

  • return an appropriate error if DNS look-up does not resolve to CNAME.

You can’t perform that action at this time.