From ce856323906e4c7eafd55de8500e75f42fa93ca0 Mon Sep 17 00:00:00 2001 From: Olaoluwa Osuntokun Date: Sun, 18 Mar 2018 16:04:22 -0700 Subject: [PATCH] discovery: ensure target host for DNS fallback is fully qualified MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- discovery/bootstrapper.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/discovery/bootstrapper.go b/discovery/bootstrapper.go index 507c7fb5..aed159fb 100644 --- a/discovery/bootstrapper.go +++ b/discovery/bootstrapper.go @@ -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()