wealdtech / coredns-ens

Apache License 2.0
57 stars 15 forks source link

Not resolving any TLD with a standalone build #19

Closed talentlessguy closed 4 months ago

talentlessguy commented 4 months ago
 ╰─λ sudo ./coredns
.:53
CoreDNS-1.8.3
linux/amd64, go1.22.2, 4293992bb-dirty
[INFO] 127.0.0.1:39650 - 11317 "AAAA IN v1rtl.eth. udp 27 false 512" NOERROR qr,aa,rd 85 0.00017179s
[INFO] 127.0.0.1:39650 - 54026 "A IN v1rtl.eth. udp 27 false 512" NOERROR qr,aa,rd 85 0.000065235s
[INFO] 127.0.0.1:40940 - 10286 "AAAA IN v1rtl.site. udp 28 false 512" NOERROR qr,aa,rd 88 0.000071876s
[INFO] 127.0.0.1:40940 - 49709 "A IN v1rtl.site. udp 28 false 512" NOERROR qr,aa,rd 88 0.000042376s

I was trying to query both .eth and regular DNS TLDs, both seem to fail.

I've stopped systemd-resolved because it was also running on :53 and I've put nameserver 127.0.0.1 to /etc/resolv.conf

I'm on Linux 6.9.4, Garuda Linux

mcdee commented 4 months ago

It doesn't look like this domain has an A record assigned to it:

ethereal dns get --domain=v1rtl.eth --resource=A
No value of A resource v1rtl.eth. for v1rtl.eth.
talentlessguy commented 4 months ago

It doesn't look like this domain has an A record assigned to it:

ethereal dns get --domain=v1rtl.eth --resource=A
No value of A resource v1rtl.eth. for v1rtl.eth.

oh.. I thought it resolves Content-Hash

mcdee commented 4 months ago

You cannot resolve an A record directly to a content hash in a DNS server. The A record should point to an ENS-enabled IPFS gateway, for example 104.17.96.13 (which is one of the addresses for the Cloudflare IPFS gateway).

talentlessguy commented 4 months ago

You cannot resolve an A record directly to a content hash in a DNS server. The A record should point to an ENS-enabled IPFS gateway, for example 104.17.96.13 (which is one of the addresses for the Cloudflare IPFS gateway).

oh I see, thanks for explaining this! by "A" record do you mean a TXT record in ENS with key "A" and value as the IP, or you mean ENSIP-6 records? sorry for my lack of knowledge

in any case setting a gateway record seems like you're bound to a specific one, I was thinking of resolving ENS using a local IPFS gateway. not sure if that's possible but that would be the best approach for people running their a local IPFS node

mcdee commented 4 months ago

oh I see, thanks for explaining this! by "A" record do you mean a TXT record in ENS with key "A" and value as the IP, or you mean ENSIP-6 records? sorry for my lack of knowledge

It's out-of-date, but https://wealdtech.eth.limo/articles/using-ethdns-to-host-your-dns-domain/ explains how this used to work. I believe that the DNS features are now part of the standard resolver.

in any case setting a gateway record seems like you're bound to a specific one, I was thinking of resolving ENS using a local IPFS gateway. not sure if that's possible but that would be the best approach for people running their a local IPFS node

IPFS gateways that are ENS-enabled will query the chain for the contenthash themselves, so no need to run a DNS gateway. Or you could add multiple A records for multiple gateways. It really depends on your use case.

https://blog.cloudflare.com/cloudflare-distributed-web-resolver also provides information about the process.

talentlessguy commented 4 months ago

oh I see, thanks for explaining this! by "A" record do you mean a TXT record in ENS with key "A" and value as the IP, or you mean ENSIP-6 records? sorry for my lack of knowledge

It's out-of-date, but https://wealdtech.eth.limo/articles/using-ethdns-to-host-your-dns-domain/ explains how this used to work. I believe that the DNS features are now part of the standard resolver.

in any case setting a gateway record seems like you're bound to a specific one, I was thinking of resolving ENS using a local IPFS gateway. not sure if that's possible but that would be the best approach for people running their a local IPFS node

IPFS gateways that are ENS-enabled will query the chain for the contenthash themselves, so no need to run a DNS gateway. Or you could add multiple A records for multiple gateways. It really depends on your use case.

https://blog.cloudflare.com/cloudflare-distributed-web-resolver also provides information about the process.

ENS supports DNSSEC-enabled off-chain domain import, that's true. But it's a different functionality, it's to be able to claim ownership of an offchain domain on ENS.

My use case is being able to resolve .eth domains through a custom DNS server, preferably with a local IPFS gateway running. IPFS Kubo (official server implementation) supports ENS resolution via IPNS namespace, aka v1rtl.eth.ipns.localhost:8080

my final goal is being able to do ping v1rtl.eth and it would ping my IPFS gateway, and opening v1rtl.eth in the browser would open my site served from IPFS