Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add DoH client (HTTP/1.1) #2

Merged
merged 7 commits into from
Apr 13, 2024
Merged

Add DoH client (HTTP/1.1) #2

merged 7 commits into from
Apr 13, 2024

Conversation

taketo1113
Copy link
Owner

Summary

Add DoH client (HTTP/1.1) via Net::HTTP

Change Set

  • Added resolver of doh client (http/1.1)
  • Added cli option of resolve type: --doh-h1

Usage

  • Ruby
doh = Ddig::Resolver::DohH1.new(hostname: 'dns.google', server: 'dns.google', dohpath: '/dns-query{?dns}').lookup
=> #<Ddig::Resolver::DohH1:0x00000001023ed020 @a=["8.8.4.4", "8.8.8.8"], @aaaa=["2001:4860:4860::8888", "2001:4860:4860::8844"], @address=nil, @dohpath="/dns-query{?dns}", @hostname="dns.google", @open_timeout=10, @port=443, @server="dns.google">

doh.a
=> ["8.8.4.4", "8.8.8.8"]
doh.aaaa
=> ["2001:4860:4860::8844", "2001:4860:4860::8888"]
  • CLI
$ ddig --doh-h1 --nameserver dns.google --doh-path /dns-query{?dns} dns.google
dns.google	A	8.8.8.8
dns.google	A	8.8.4.4
dns.google	AAAA	2001:4860:4860::8888
dns.google	AAAA	2001:4860:4860::8844

# SERVER(Hostname): dns.google
# SERVER(Path): /dns-query{?dns}
# PORT: 443

@taketo1113 taketo1113 self-assigned this Apr 13, 2024
@taketo1113 taketo1113 merged commit d12fe2a into master Apr 13, 2024
6 checks passed
@taketo1113 taketo1113 deleted the doh-h1-net-http branch April 13, 2024 08:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant