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

feat(gateway): allow localhost http:// DoH resolvers #645

Merged
merged 7 commits into from
Jan 8, 2025

Conversation

lidel
Copy link
Member

@lidel lidel commented Jul 29, 2024

This PR allows people to run own DNS over HTTP(S) resolver on the same box (localhost) without setting up unnecessary TLS certs.

Main use case is to simplify self-hosting of non-ICANN DNS systems such as ENS resolver (https://github.com/ethlimo/limo-web3-dns) by gateway operators who don't want to trust third-party DNS resolvers.

@lidel lidel force-pushed the fix/allow-local-doh-endpoints branch from e99d6ba to f736895 Compare July 29, 2024 21:28
Copy link

codecov bot commented Jul 29, 2024

Codecov Report

Attention: Patch coverage is 0% with 2 lines in your changes missing coverage. Please review.

Project coverage is 60.55%. Comparing base (08526ad) to head (df49e98).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
gateway/dns.go 0.00% 1 Missing and 1 partial ⚠️

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #645      +/-   ##
==========================================
+ Coverage   60.50%   60.55%   +0.04%     
==========================================
  Files         245      245              
  Lines       31133    31133              
==========================================
+ Hits        18838    18852      +14     
+ Misses      10621    10607      -14     
  Partials     1674     1674              
Files with missing lines Coverage Δ
gateway/dns.go 60.00% <0.00%> (+22.22%) ⬆️

... and 8 files with indirect coverage changes

aschmahmann and others added 3 commits December 23, 2024 14:01
allows people to run own DoH resolver on the same box
or within same secure VLAN/VPN/infra
@aschmahmann aschmahmann force-pushed the fix/allow-local-doh-endpoints branch from 52cdf46 to 3a62179 Compare December 23, 2024 19:01
go.mod Outdated Show resolved Hide resolved
@aschmahmann
Copy link
Contributor

aschmahmann commented Dec 23, 2024

Main use case is to simplify self-hosting of ENS resolves by gateway operations etc.

This PR works and for tools like CoreDNS that support DNS over HTTP (and not just HTTPS) this might be enough. If there's not enough support here folks might end up asking us for DNS over UDP / TCP support, but we can tackle that as the need arises.

For what it's worth a nice thing about pushing on DNS-over-HTTP is that it makes it easier for folks who want to self-host while also using web-browsers since UDP/TCP are not available to javascript in browsers. For some cases like ENS this might not be a big deal since they can wrap the Ethereum JSON-RPC, but it might matter for other name systems.

@aschmahmann
Copy link
Contributor

Updated the comment above given that CoreDNS does support DNS-over-HTTP in addition to DNS-over-HTTPS.

FYI CoreDNS (and therefore the CoreDNS ENS resolver) supports DNS-over-HTTP, although the UX for this is that you configure listening on "https://" rather than "http://" and just not pass a certificate (which is what tripped me up initially 😅).

I think we should be good to go on a merge here, pending reviews.

@lidel lidel changed the title fix(dns): allow http:// DoH resolvers fix(dns): allow localhost http:// DoH resolvers Jan 8, 2025
@lidel lidel mentioned this pull request Jan 8, 2025
60 tasks
@lidel lidel marked this pull request as ready for review January 8, 2025 22:08
@lidel lidel requested a review from a team as a code owner January 8, 2025 22:09
@lidel
Copy link
Member Author

lidel commented Jan 8, 2025

@aschmahmann thank you for adding tests and libp2p/go-doh-resolver#28. Lgtm.

I've reviewed libp2p/go-doh-resolver#28, limited it to localhost, merged, released, and switched this PR to go-doh-resolver v0.5.0.

Merging as it cleans up go.mod as bit as well.

@lidel lidel merged commit 1097a4b into main Jan 8, 2025
19 checks passed
@lidel lidel deleted the fix/allow-local-doh-endpoints branch January 8, 2025 22:15
@lidel lidel changed the title fix(dns): allow localhost http:// DoH resolvers feat(gateway): allow localhost http:// DoH resolvers Jan 8, 2025
lidel added a commit to ipfs/kubo that referenced this pull request Jan 14, 2025
lidel added a commit to ipfs/kubo that referenced this pull request Jan 14, 2025
* fix(dns): update default DNSLink resolvers

Depends on
- ipfs/boxo#781
- ipfs/boxo#782

* chore: latest boxo main and go-doh-resolver v0.5.0

makes error message better, informing which URL failled

* chore: p2p-forge v0.2.1+

this removes acmez/v2 and fixes go vet

* chore: latest boxo with DoH fixes

commit from main branch that includes:
ipfs/boxo#645
ipfs/boxo#782
ipfs/boxo#781
lidel added a commit to ipfs/kubo that referenced this pull request Jan 14, 2025
* fix(dns): update default DNSLink resolvers

Depends on
- ipfs/boxo#781
- ipfs/boxo#782

* chore: latest boxo main and go-doh-resolver v0.5.0

makes error message better, informing which URL failled

* chore: p2p-forge v0.2.1+

this removes acmez/v2 and fixes go vet

* chore: latest boxo with DoH fixes

commit from main branch that includes:
ipfs/boxo#645
ipfs/boxo#782
ipfs/boxo#781

(cherry picked from commit b021a00)
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.

2 participants