Project

doh_client

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

Development

~> 2.0
~> 0.8
~> 12.3
~> 3.8
~> 4.0
~> 3.5

Runtime

~> 1.2
~> 4.0
~> 0.19
 Project Readme

doh_client

Build Status Maintainability Coverage Status

DNS over HTTPS (DoH) client for Ruby

Installation

Add this line to your application's Gemfile:

gem 'doh_client'

And then execute:

$ bundle

Or install it yourself as:

$ gem install doh_client

Supported platforms

Usage

As a Library

require 'doh_client'

DoHClient::Client::Google.resolve("example.com", { type: "A" })
DoHClient::Client::Google.resolve("example.com", { type: "A", edns_client_subnet: "0.0.0.0/0", random_padding: "XmkMw~o_mgP2pf.gpw-Oi5dK" })

DoHClient::Client::Cloudflare.resolve("example.com", { type: "A" })
DoHClient::Client::Cloudflare.resolve("example.com", { type: "A", do: true, cd: false })

As a CLI

$ doh_client
Commands:
  doh_client act_as_server   # act as a local DNS server on a given port (default: 5300)
  doh_client help [COMMAND]  # Describe available commands or one specific command
  doh_client resolve [NAME]  # resolve a given name

Options:
  [--resolver=RESOLVER]  # a resolver to use ('google' or 'cloudflare', default: google)

$ doh_client resolve example.com --type A
# => {"Status":0,"TC":false,"RD":true,"RA":true,"AD":true,"CD":false,"Question":[{"name":"example.com.","type":1}],"Answer":[{"name":"example.com.","type":1,"TTL":5169,"data":"93.184.216.34"}]

$ doh_client act_as_server
# => Starting DNS server 0.0.0.0:5300 (tcp/udp)

License

The gem is available as open source under the terms of the MIT License.