Skip to content

feat: refactor lookup logic #161

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
May 31, 2024
Merged

feat: refactor lookup logic #161

merged 1 commit into from
May 31, 2024

Conversation

agaffney
Copy link
Contributor

This commit does the following:

  • support lookup of more than NS from local storage
  • add convenience function for converting from our storage format to dns.RR
  • remove NS lookup logic for fallback servers and pass along query verbatim if not in local storage
  • remove (now) unneeded state helper function

Fixes #107 and #159

This commit does the following:

* support lookup of more than NS from local storage
* add convenience function for converting from our storage format to
  dns.RR
* remove NS lookup logic for fallback servers and pass along query
  verbatim if not in local storage
* remove (now) unneeded state helper function

Fixes #107 and #159
@agaffney
Copy link
Contributor Author

$ dig @localhost -p 8053 foo.county.cardano

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

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

;; AUTHORITY SECTION:
county.cardano.		999	IN	NS	ns1.county.cardano.

;; ADDITIONAL SECTION:
ns1.county.cardano.	999	IN	A	172.28.0.2

;; Query time: 0 msec
;; SERVER: 127.0.0.1#8053(localhost) (UDP)
;; WHEN: Wed May 29 16:50:29 CDT 2024
;; MSG SIZE  rcvd: 116
$ dig @localhost -p 8053 ns1.county.cardano

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

;; QUESTION SECTION:
;ns1.county.cardano.		IN	A

;; ANSWER SECTION:
ns1.county.cardano.	3600	IN	A	172.28.0.2

;; Query time: 0 msec
;; SERVER: 127.0.0.1#8053(localhost) (UDP)
;; WHEN: Wed May 29 16:50:30 CDT 2024
;; MSG SIZE  rcvd: 70
$ dig @localhost -p 8053 www.google.com

; <<>> DiG 9.18.18-0ubuntu0.22.04.2-Ubuntu <<>> @localhost -p 8053 www.google.com
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 45967
;; flags: qr rd ra; QUERY: 1, ANSWER: 6, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 512
;; QUESTION SECTION:
;www.google.com.			IN	A

;; ANSWER SECTION:
www.google.com.		199	IN	A	142.250.114.147
www.google.com.		199	IN	A	142.250.114.104
www.google.com.		199	IN	A	142.250.114.99
www.google.com.		199	IN	A	142.250.114.106
www.google.com.		199	IN	A	142.250.114.103
www.google.com.		199	IN	A	142.250.114.105

;; Query time: 59 msec
;; SERVER: 127.0.0.1#8053(localhost) (UDP)
;; WHEN: Wed May 29 16:50:32 CDT 2024
;; MSG SIZE  rcvd: 223

@agaffney agaffney merged commit dc37ce8 into main May 31, 2024
9 checks passed
@agaffney agaffney deleted the feat/recursive-fallback branch May 31, 2024 15:56
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.

Use recursive queries to fallback servers
2 participants