discovery: ensure target host for DNS fallback is fully qualified

In this commit, fix the inability of some users to connect to the DNS
seed using our direct TCP fallback. We do this as some resolvers filter
out our large SRV requests due to their size (they also include public
keys). Instead, we’ll use a direct TCP resolution in this case.
However, after a recent change, we forgot the period at the end of the
target DNS host. This is an issue as the domain needs to be fully
qualified.

The fix is easy, add a period within our string formatting to target
the proper sub-domain and SRV target.

Fixes #854.
This commit is contained in:
Olaoluwa Osuntokun 2018-03-18 16:04:22 -07:00
parent 47329c9267
commit ce85632390
No known key found for this signature in database
GPG Key ID: 964EA263DD637C21

View File

@ -298,7 +298,7 @@ func fallBackSRVLookup(soaShim string, targetEndPoint string) ([]*net.SRV, error
return nil, err
}
dnsHost := fmt.Sprintf("_nodes._tcp.%v", targetEndPoint)
dnsHost := fmt.Sprintf("_nodes._tcp.%v.", targetEndPoint)
dnsConn := &dns.Conn{Conn: conn}
defer dnsConn.Close()