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

resolver: fix CNAME -> TXT recursion #124

Merged
merged 2 commits into from
Apr 3, 2024
Merged

Conversation

cee-dub
Copy link
Member

@cee-dub cee-dub commented Apr 3, 2024

Fixes #115, #123

  • Pass non-canceled context to recursive resolveCNAMEs
  • Append correct RR in resolveCNAMEs
  • Keep TestMain at top of resolver_test.go
  • Add TestGoogleCNAME
  • Rename CheckTXT -> checkTXT
Output Changes:

Before:

$ go run ./cmd/dnsr/main.go 355702a0-beac-4944-ae69-73c70d68b5c3.miniwoffer.no TXT

;; RESULTS:
355702a0-beac-4944-ae69-73c70d68b5c3.miniwoffer.no.	      3600	IN	CNAME	355702a0-beac-4944-ae69-73c70d68b5c3.miniwoffer.no.wordcore.no.
;; TRUE	355702a0-beac-4944-ae69-73c70d68b5c3.miniwoffer.no	TXT
;; Elapsed: 1.4088205s

$ go run ./cmd/dnsr/main.go translate.google.com A

;; RESULTS:
translate.google.com.	      3600	IN	CNAME	www3.l.google.com.
;; TRUE	translate.google.com	A
;; Elapsed: 86.525208ms

After:

$ go run ./cmd/dnsr/main.go 355702a0-beac-4944-ae69-73c70d68b5c3.miniwoffer.no TXT

;; RESULTS:
355702a0-beac-4944-ae69-73c70d68b5c3.miniwoffer.no.	      3600	IN	CNAME	355702a0-beac-4944-ae69-73c70d68b5c3.miniwoffer.no.wordcore.no.
355702a0-beac-4944-ae69-73c70d68b5c3.miniwoffer.no.wordcore.no.	      3600	IN	TXT	foobar
;; TRUE	355702a0-beac-4944-ae69-73c70d68b5c3.miniwoffer.no	TXT
;; Elapsed: 1.582778084sdig +short 355702a0-beac-4944-ae69-73c70d68b5c3.miniwoffer.no TXT
355702a0-beac-4944-ae69-73c70d68b5c3.miniwoffer.no.wordcore.no.
"foobar"

$ go run ./cmd/dnsr/main.go translate.google.com A

;; RESULTS:
translate.google.com.	      3600	IN	CNAME	www3.l.google.com.
www3.l.google.com.	      3600	IN	A	142.250.114.101
www3.l.google.com.	      3600	IN	A	142.250.114.100
www3.l.google.com.	      3600	IN	A	142.250.114.102
www3.l.google.com.	      3600	IN	A	142.250.114.138
www3.l.google.com.	      3600	IN	A	142.250.114.139
www3.l.google.com.	      3600	IN	A	142.250.114.113
;; TRUE	translate.google.com	A
;; Elapsed: 144.930083ms

$ dig +short translate.google.com
www3.l.google.com.
142.250.113.139
142.250.113.113
142.250.113.102
142.250.113.101
142.250.113.100
142.250.113.138

* Pass non-canceled context to recursive resolveCNAMEs
* Append correct RR in resolveCNAMEs
* Keep TestMain at top of resolver_test.go
* Add TestGoogleCNAME
* Rename CheckTXT -> checkTXT
@cee-dub cee-dub self-assigned this Apr 3, 2024
@cee-dub cee-dub merged commit d70435f into main Apr 3, 2024
2 checks passed
@cee-dub cee-dub deleted the cw/maintaining-domaining branch April 3, 2024 20:09
@cee-dub cee-dub mentioned this pull request Apr 3, 2024
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.

1 participant