• Stars
    star
    188
  • Rank 205,563 (Top 5 %)
  • Language
    Ruby
  • License
    MIT License
  • Created over 14 years ago
  • Updated 7 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

The DNSimple API client for Ruby.

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.

Requirements

  • Ruby: MRI > 2.7+

Installation

You can install the gem manually:

gem install dnsimple

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

gem 'dnsimple', '~> 6.0'

Documentation

Relevant links

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 = Dnsimple::Client.new(base_url: "https://api.sandbox.dnsimple.com", 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.

Examples

Be sure to require the gem before trying any of the examples:

require 'dnsimple'

Setting a custom User-Agent header

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

client = Dnsimple::Client.new(user_agent: "my-app/1.0")

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

We recommend to customize the user agent. If you are building a library or integration on top of the official client, customizing the client will help us to understand what is this client used for, and allow to contribute back or get in touch.

Authentication

client = Dnsimple::Client.new(access_token: "a1b2c3")

# Fetch your details
response = client.identity.whoami   # execute the call
response.data                       # extract the relevant data from the response or
client.identity.whoami.data         # 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 = client.identity.whoami.data
account_id = whoami.account.id

Listing your domains

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

Create a domain

response = client.domains.create_domain(account_id, name: "example.com")
puts response.data

Get a domain

response = client.domains.domain(account_id, "example.com")
puts response.data

License

Copyright (c) 2010-2022 DNSimple Corporation. This is Free Software distributed under the MIT license.

More Repositories

1

erldns

DNS server, in Erlang.
Erlang
392
star
2

dns_erlang

Erlang DNS library.
Erlang
94
star
3

dnsimple-go

The DNSimple API client for Go.
Go
75
star
4

dnsimple-python

The DNSimple API client for Python.
Python
65
star
5

dnsimple-services

One-click service configurations for DNSimple.
Ruby
51
star
6

dnsimple-elixir

The DNSimple API client for Elixir.
Elixir
50
star
7

dnsimple-node

The DNSimple API client for Node.js.
TypeScript
48
star
8

chef-dnsimple

Chef cookbook for DNSimple.
Ruby
38
star
9

dnsimple-developer

The DNSimple API Documentation.
HTML
35
star
10

erldns-admin

Admin API for erldns.
Erlang
26
star
11

dnsimple-api-examples

Example scripts and code to demonstrate how to use the DNSimple API.
Ruby
26
star
12

dnstest

Erlang app for testing authoritative DNS servers for compliance.
Erlang
24
star
13

chef-pdns

Development repository for DNSimple Cookbook PowerDNS.
Ruby
23
star
14

strillone

Listen to incoming webhooks from DNSimple, and publish them to a Slack channel or other messaging service.
Go
23
star
15

terraform-provider-dnsimple

Terraform DNSimple provider.
Go
21
star
16

go-remote-control

Daemon that runs on hosts and provides limited remote control access.
Go
20
star
17

exdns

Elixir port of erldns.
Elixir
16
star
18

erldns-metrics

Metrics endpoint for erldns.
Erlang
12
star
19

base32_erlang

Erlang implementation of base32 encoding and decoding.
Erlang
12
star
20

dnsimple-support

HTML
12
star
21

dnsimple-csharp

The DNSimple API client for C#.
C#
12
star
22

dnsimple-rust

The DNSimple API client for Rust.
Rust
10
star
23

dnsimple-php

The DNSimple API client for PHP.
PHP
10
star
24

dnsimple-java

The DNSimple API client for Java.
Java
8
star
25

dnsimple-elixir-cli

An example of a CLI for DNSimple built in Elixir.
Elixir
7
star
26

addon-digitalocean

A connector add-on for Digital Ocean
Elixir
5
star
27

hello-domains-hanami

Hello Domains, the Hello World for the DNSimple API, implemented with Ruby & Hanami
Ruby
4
star
28

hello-domains-rails

Hello Domains, the Hello World for the DNSimple API, implemented with Ruby & Rails
Ruby
4
star
29

coredns-dnsimple

A DNSimple plugin for CoreDNS.
Go
4
star
30

dnsimple-ruby-cli

An example of a CLI for DNSimple built in Ruby.
Ruby
3
star
31

terraform-dnsimple-cts

DNSimple Consult-Terraform-Sync NIA integration to manage your DNS records.
HCL
3
star
32

hello-domains-node

Hello Domains, the Hello World for the DNSimple API, implemented in Node.js
JavaScript
3
star
33

omniauth-dnsimple

DNSimple strategy for OmniAuth
Ruby
2
star
34

hubot-dnsimple

A hubot script that interacts with DNSimple.
CoffeeScript
2
star
35

addon-github-pages

Connector for GitHub Pages
Elixir
1
star
36

hello-domains-phoenix

Hello Domains, the Hello World for the DNSimple API, implemented in Elixir & Phoenix
Elixir
1
star
37

chef-dnsimple_demo

A demo for conventions and webinars.
Ruby
1
star
38

policy-library-dnsimple-terraform

Prescriptive Sentinel Policies for Establishing Secure Terraform Configurations for Domains and DNS in DNSimple
HCL
1
star
39

addon-export-csv

Export your domains in CSV format with this simple addon
Ruby
1
star
40

addon-email-report

Add-on to send regular domain reports via email
Elixir
1
star
41

addon-heroku

Connect DNSimple domains to Heroku apps
Elixir
1
star