Briefly, this error occurs when Elasticsearch is unable to resolve the hostname specified in the configuration. This could be due to a typo in the hostname, network issues, or DNS resolution problems. To resolve this issue, you can check the hostname for typos, verify your network connection, or check your DNS settings. If the problem persists, you may need to use an IP address instead of a hostname.
This guide will help you check for common problems that cause the log ” Failed to resolve host [” + Arrays.toString(bindHosts) + “] ” to appear. To understand the issues related to this log, read the explanation below about the following Elasticsearch concepts: .
Log Context
Log “Failed to resolve host [” + Arrays.toString(bindHosts) + “]” class name is AbstractHttpServerTransport.java. We extracted the following from Elasticsearch source code for those seeking an in-depth context :
// Bind and start to accept incoming connections. final InetAddress[] hostAddresses; try { hostAddresses = networkService.resolveBindHostAddresses(bindHosts); } catch (IOException e) { throw new BindHttpException("Failed to resolve host [" + Arrays.toString(bindHosts) + "]"; e); } ListboundAddresses = new ArrayList<>(hostAddresses.length); for (InetAddress address : hostAddresses) { boundAddresses.add(bindAddress(address));