Skip to content

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

@gsejourne

Description

@gsejourne

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 [].

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions