n0-computer / iroh

A toolkit for building distributed applications
https://iroh.computer
Apache License 2.0
2.35k stars 150 forks source link

n0 dns server doesn't return relay records #2412

Closed dvc94ch closed 2 months ago

dvc94ch commented 3 months ago

records can be resolved with https://app.pkarr.org when pointing it to https://dns.iroh.link/pkarr. a bit surprising is that the relayer doesn't publish to the dht, so you can't resolve it with a different relayer. Seems like this is intended after discussing with @rklaehn . however the DnsResolver (the only one currently provided by default in iroh-net) fails to return any records. trying to query it manually seems to show that the problem is with the n0 dns server.

dig _iroh.7qy7is9kco9oygshi4ocmbw5ibogm4jme659bdgkrbthkwzxy5yy.dns.iroh.link. txt

; <<>> DiG 9.18.27 <<>> _iroh.7qy7is9kco9oygshi4ocmbw5ibogm4jme659bdgkrbthkwzxy5yy.dns.iroh.link. txt
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 42232
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 65494
;; QUESTION SECTION:
;_iroh.7qy7is9kco9oygshi4ocmbw5ibogm4jme659bdgkrbthkwzxy5yy.dns.iroh.link. IN TXT

;; AUTHORITY SECTION:
dns.iroh.link.      7007    IN  SOA testdns.iroh.link. hostmaster.iroh.link. 1 7200 900 1209600 86400

;; Query time: 3 msec
;; SERVER: 127.0.0.53#53(127.0.0.53) (UDP)
;; WHEN: Wed Jun 26 12:30:40 CEST 2024
;; MSG SIZE  rcvd: 156
rklaehn commented 3 months ago

@Frando ?

Frando commented 3 months ago
$ dig _iroh.7qy7is9kco9oygshi4ocmbw5ibogm4jme659bdgkrbthkwzxy5yy.dns.iroh.link. TXT

; <<>> DiG 9.18.24 <<>> _iroh.7qy7is9kco9oygshi4ocmbw5ibogm4jme659bdgkrbthkwzxy5yy.dns.iroh.link. TXT
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 52136
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 1232
;; QUESTION SECTION:
;_iroh.7qy7is9kco9oygshi4ocmbw5ibogm4jme659bdgkrbthkwzxy5yy.dns.iroh.link. IN TXT

;; ANSWER SECTION:
_iroh.7qy7is9kco9oygshi4ocmbw5ibogm4jme659bdgkrbthkwzxy5yy.dns.iroh.link. 18 IN TXT "relay=https://euw1-1.relay.iroh.network./"

;; Query time: 1870 msec
;; SERVER: 10.23.1.1#53(10.23.1.1) (UDP)
;; WHEN: Wed Jun 26 13:17:21 CEST 2024
;; MSG SIZE  rcvd: 155

?

dvc94ch commented 3 months ago

mmh, how long does it take for the record to propagate? the pkarr relay interface returns the record immediately

dvc94ch commented 3 months ago

seems to be some issue somewhere in the dns stack. checked my dns config and the system resolver starts resolving the record after a while, but somehow the node never manages to resolve itself. possibly a local issue, so fine if you want to close it. for now I'll work around it by implementing a resolver using the pkarr http interface.

flub commented 3 months ago
> dig -t SOA dns.iroh.link

; <<>> DiG 9.19.25-185-g392e7199df2-1-Debian <<>> -t SOA dns.iroh.link
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 28062
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 512
;; QUESTION SECTION:
;dns.iroh.link.         IN  SOA

;; ANSWER SECTION:
dns.iroh.link.      86217   IN  SOA testdns.iroh.link. hostmaster.iroh.link. 1 7200 900 1209600 86400

;; Query time: 4 msec
;; SERVER: 192.168.1.1#53(192.168.1.1) (UDP)
;; WHEN: Mon Jul 01 11:41:46 CEST 2024
;; MSG SIZE  rcvd: 97

IIUC this means the authoritative DNS server asks any clients (or recursive DNS servers) to remember the fact that a record was missing for 86400 seconds, or 24 hours. That is way to long for how this service works. So I think this is a misconfiguration of the DNS server probably.