Skip to content

feat: explicitly query fallback servers for NS records #45

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

Merged
merged 1 commit into from
Oct 5, 2023

Conversation

agaffney
Copy link
Contributor

@agaffney agaffney commented Oct 5, 2023

Fixes #29

@agaffney
Copy link
Contributor Author

agaffney commented Oct 5, 2023

$ LOGGING_LEVEL=debug ./cdnsd 
{"level":"info","timestamp":"2023-10-04T19:56:28-05:00","caller":"indexer/indexer.go:64","msg":"found previous chainsync cursor: 34352991, 06bf848293c5fedb326134351ea0b68efae0445c1332929665ecd25b46d0c92b"}
{"level":"info","timestamp":"2023-10-04T19:56:29-05:00","caller":"cdnsd/main.go:72","msg":"starting DNS listener on :8053"}
{"level":"info","timestamp":"2023-10-04T19:56:35-05:00","caller":"dns/dns.go:43","msg":"query: name: foo.bar.com., type: A, class: IN"}
{"level":"debug","timestamp":"2023-10-04T19:56:35-05:00","caller":"dns/dns.go:185","msg":"querying 103.196.38.40:53: NS foo.bar.com."}
{"level":"debug","timestamp":"2023-10-04T19:56:35-05:00","caller":"dns/dns.go:185","msg":"querying 103.196.38.40:53: NS bar.com."}
{"level":"debug","timestamp":"2023-10-04T19:56:35-05:00","caller":"dns/dns.go:185","msg":"querying 103.196.38.40:53: A luke.ns.cloudflare.com."}
{"level":"debug","timestamp":"2023-10-04T19:56:35-05:00","caller":"dns/dns.go:185","msg":"querying 103.196.38.40:53: A pam.ns.cloudflare.com."}
{"level":"info","timestamp":"2023-10-04T19:56:38-05:00","caller":"dns/dns.go:43","msg":"query: name: foo.dolphin.cardano., type: A, class: IN"}
$ dig @localhost -p 8053 foo.dolphin.cardano

; <<>> DiG 9.18.12-0ubuntu0.22.04.3-Ubuntu <<>> @localhost -p 8053 foo.dolphin.cardano
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 17593
;; flags: qr rd; QUERY: 1, ANSWER: 0, AUTHORITY: 2, ADDITIONAL: 2
;; WARNING: recursion requested but not available

;; QUESTION SECTION:
;foo.dolphin.cardano.           IN      A

;; AUTHORITY SECTION:
dolphin.cardano.        999     IN      NS      ns2.dolphin.cardano.
dolphin.cardano.        999     IN      NS      ns1.dolphin.cardano.

;; ADDITIONAL SECTION:
ns2.dolphin.cardano.    999     IN      A       42.42.31.31
ns1.dolphin.cardano.    999     IN      A       0.0.0.0

;; Query time: 0 msec
;; SERVER: 127.0.0.1#8053(localhost) (UDP)
;; WHEN: Wed Oct 04 19:56:38 CDT 2023
;; MSG SIZE  rcvd: 203
$ dig @localhost -p 8053 foo.bar.com

; <<>> DiG 9.18.12-0ubuntu0.22.04.3-Ubuntu <<>> @localhost -p 8053 foo.bar.com
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 41495
;; flags: qr rd; QUERY: 1, ANSWER: 0, AUTHORITY: 2, ADDITIONAL: 6
;; WARNING: recursion requested but not available

;; QUESTION SECTION:
;foo.bar.com.                   IN      A

;; AUTHORITY SECTION:
bar.com.                999     IN      NS      luke.ns.cloudflare.com.
bar.com.                999     IN      NS      pam.ns.cloudflare.com.

;; ADDITIONAL SECTION:
luke.ns.cloudflare.com. 999     IN      A       173.245.59.200
luke.ns.cloudflare.com. 999     IN      A       172.64.33.200
luke.ns.cloudflare.com. 999     IN      A       108.162.193.200
pam.ns.cloudflare.com.  999     IN      A       108.162.192.138
pam.ns.cloudflare.com.  999     IN      A       173.245.58.138
pam.ns.cloudflare.com.  999     IN      A       172.64.32.138

;; Query time: 256 msec
;; SERVER: 127.0.0.1#8053(localhost) (UDP)
;; WHEN: Wed Oct 04 19:56:35 CDT 2023
;; MSG SIZE  rcvd: 339

@agaffney agaffney force-pushed the feat/fallback-query-ns branch from f37208f to 6530134 Compare October 5, 2023 00:59
@agaffney agaffney merged commit c5b2bae into main Oct 5, 2023
@agaffney agaffney deleted the feat/fallback-query-ns branch October 5, 2023 15:39
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.

Change non-recursive fallback behavior to only query NS records
2 participants