百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
D

dnsimple-ruby

> 开发工具
开源

适用于 Ruby 的 DNSimple API 客户端。

188 stars0 点赞3 次浏览
访问官网GitHub

工具介绍

适用于 Ruby 的 DNSimple API 客户端。

DNSimple Ruby Client

A Ruby client for the DNSimple API v2. 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 > 3.2+
  • An activated DNSimple account

Installation

You can install the gem manually:

bash
gem install dnsimple

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

ruby
gem 'dnsimple', '~> 11.0'

Usage

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

ruby
require 'dnsimple'

Authentication

ruby
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

ruby
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

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

Get a domain

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

Research a domain

Note: This endpoint is part of a Private Beta. During the beta period, changes to the endpoint may occur at any time. If interested in using this endpoint, reach out to DNSimple support.

Research a domain name for availability and registration status information:

ruby
response = client.domains.domain_research_status(account_id, "example.com")
research = response.data
puts research.domain          # => "example.com"
puts research.availability    # => "unavailable"
puts research.request_id      # => "f453dabc-a27e-4bf1-a93e-f263577ffaae"
puts research.errors          # => []

Configuration

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:

ruby
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.

Setting a custom User-Agent header

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

ruby
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.

Documentation

  • dnsimple-ruby RDocs.
  • DNSimple API documentation.
  • DNSimple API examples repository.
  • DNSimple support documentation.

Contributing

Contributions are welcome! Please feel free to submit issues and pull requests. See CONTRIBUTING.md for guidelines.

Changelog

See CHANGELOG.md for details.

License

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

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

Rubyapiapi-clientdnsimplednsimple-api

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类开发工具
定价开源

> 相关工具

V
VS Code
流行的开源代码编辑器
G
Git
分布式版本控制系统
V
Vite
下一代前端构建工具