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

Fails on CNAMEs #1

Closed
robbat2 opened this issue Apr 15, 2023 · 1 comment
Closed

Fails on CNAMEs #1

robbat2 opened this issue Apr 15, 2023 · 1 comment

Comments

@robbat2
Copy link

robbat2 commented Apr 15, 2023

$ ./srv-plz  --dns 8.8.8.8:53   _x-puppet._tcp.puppet.infra.gentoo.org. 
panic: interface conversion: dns.RR is *dns.CNAME, not *dns.SRV

goroutine 1 [running]:
github.com/neomantra/srv-plz/pkg/lookup.LookupSRVCustom({0x7ffd68e1758d, 0x27}, {0x7ffd68e17582, 0xa}, 0x0)
	(REDACTED)/srv-plz/pkg/lookup/loopkup_srv.go:72 +0x4f4
main.main()
	(REDACTED)/srv-plz/cmd/srv-plz/main.go:171 +0x9a7

DNS view:

$ dig @8.8.8.8 _x-puppet._tcp.puppet.infra.gentoo.org.  IN SRV

; <<>> DiG 9.16.37 <<>> @8.8.8.8 _x-puppet._tcp.puppet.infra.gentoo.org. IN SRV
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 40372
;; flags: qr rd ra ad; QUERY: 1, ANSWER: 4, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 512
;; QUESTION SECTION:
;_x-puppet._tcp.puppet.infra.gentoo.org.	IN SRV

;; ANSWER SECTION:
_x-puppet._tcp.puppet.infra.gentoo.org.	600 IN CNAME _x-puppet._tcp.puppet.infra.geodns.gentoo.org.
_x-puppet._tcp.puppet.infra.geodns.gentoo.org. 900 IN CNAME _x-puppet._tcp.puppet.infra.geodns-europe.gentoo.org.
_x-puppet._tcp.puppet.infra.geodns-europe.gentoo.org. 600 IN SRV 0 100 8141 petrel.gentoo.org.
_x-puppet._tcp.puppet.infra.geodns-europe.gentoo.org. 600 IN SRV 1 100 8141 finch.gentoo.org.

;; Query time: 220 msec
;; SERVER: 8.8.8.8#53(8.8.8.8)
;; WHEN: Sat Apr 15 22:10:03 UTC 2023
;; MSG SIZE  rcvd: 245
neomantra added a commit that referenced this issue Apr 16, 2023
by adding a type assertion guard.
@neomantra
Copy link
Owner

Thanks for the report! You made it really easy to troubleshoot.

Just fixed that by skipping the CNAME records:

> ./srv-plz  --dns 8.8.8.8   _x-puppet._tcp.puppet.infra.gentoo.org
finch.gentoo.org.:8141
petrel.gentoo.org.:8141

> ./srv-plz -r --dns 8.8.8.8   _x-puppet._tcp.puppet.infra.gentoo.org
154.52.129.30:8141
140.211.166.166:8141

(I also just added auto-append of :53 too). Will be releasing this as 0.4.0.

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

No branches or pull requests

2 participants