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

IPv6 syntax error in example_test: dial udp: address <IPv6 address>:53: too many colons in address #1365

Closed
gsejourne opened this issue Apr 14, 2022 · 0 comments · Fixed by #1368

Comments

@gsejourne
Copy link

gsejourne commented Apr 14, 2022

Hey,

Run into an error trying to use the sample ExampleMX() function in example_test.go:

r, _, err := c.Exchange(m, config.Servers[0]+":"+config.Port)

It fails with the following error:
dial udp: address <my_v6_address>:53: too many colons in address

This is most likely due to r, _, err := c.Exchange(m, config.Servers[0]+":"+config.Port)
as my main resolver address is a V6 --
here's the excerpt from my resolv.conf (note: untouched, and OS X populated, so potentially highly reproducible):
`
search home

nameserver v6 address here

nameserver 192.168.1.1
`

Since the c.Exchange() function is trying config.Servers[0], it fails, as it expects the v6 address to be in [].

gsejourne pushed a commit to gsejourne/dns that referenced this issue Apr 15, 2022
gsejourne pushed a commit to gsejourne/dns that referenced this issue Apr 15, 2022
miekg added a commit that referenced this issue Apr 15, 2022
Small fix in the examples to properly work with v6 addresses.

Closes: #1365 #1367

Signed-off-by: Miek Gieben <miek@miek.nl>
miekg added a commit that referenced this issue Apr 15, 2022
Small fix in the examples to properly work with v6 addresses.

Closes: #1365 #1367

Signed-off-by: Miek Gieben <miek@miek.nl>
aanm pushed a commit to cilium/dns that referenced this issue Jul 29, 2022
Small fix in the examples to properly work with v6 addresses.

Closes: miekg#1365 miekg#1367

Signed-off-by: Miek Gieben <miek@miek.nl>
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 a pull request may close this issue.

1 participant