Skip to content
The DNSimple API client for Ruby.
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.
.rubocop_dnsimple.yml rubocop 0.57.0 Jun 6, 2018

DNSimple Ruby Client

A Ruby client for the DNSimple API v2.

Build Status Coverage Status

DNSimple provides DNS hosting and domain registration that is simple and friendly. We provide a full API and an easy-to-use web interface so you can get your domain registered and set up with a minimal amount of effort.


You can install the gem manually:

gem install dnsimple

Or use Bundler and define it as a dependency in your Gemfile:

gem 'dnsimple', '~> 4.0'


This library is a Ruby client you can use to interact with the DNSimple API v2. Here are some examples.

require 'dnsimple'

client = "a1b2c3")

# Fetch your details
response = client.identity.whoami   # execute the call                       # extract the relevant data from the response or         # execute the call and get the data in one line

# Define an account ID.
account_id = 1010

# You can also fetch it from the whoami response
# as long as you authenticate with an Account access token
whoami =
account_id =

# List your domains
puts                      # => domains from the account 1234, first page
puts, query: { page: 3 }).data  # => domains from the account 1234, third page
puts                       # => all domains from the account 1234 (use carefully)

# Create a domain
response =, name: "")

# Get a domain
response =, "")

For the full library documentation visit

Sandbox Environment

We highly recommend testing against our sandbox environment before using our production environment. This will allow you to avoid real purchases, live charges on your credit card, and reduce the chance of your running up against rate limits.

The client supports both the production and sandbox environment. To switch to sandbox pass the sandbox API host using the base_url option when you construct the client:

client = "", access_token: "a1b2c3")

You will need to ensure that you are using an access token created in the sandbox environment. Production tokens will not work in the sandbox environment.

Setting a custom User-Agent header

You customize the User-Agent header for the calls made to the DNSimple API:

client = "my-app")

The value you provide will be appended to the default User-Agent the client uses. For example, if you use my-app, the final header value will be dnsimple-ruby/4.1.0 my-app (note that it will vary depending on the client version).


Copyright (c) 2010-2018 Aetrion LLC. This is Free Software distributed under the MIT license.

You can’t perform that action at this time.