diff --git a/src/libs/zbxcomms/comms.c b/src/libs/zbxcomms/comms.c
index ae4d9b01293..31e86e52728 100644
--- a/src/libs/zbxcomms/comms.c
+++ b/src/libs/zbxcomms/comms.c
@@ -468,7 +468,7 @@ static int	zbx_socket_create(zbx_socket_t *s, int type, const char *source_ip, c
 		int timeout, unsigned int tls_connect, const char *tls_arg1, const char *tls_arg2)
 {
 	int		ret = FAIL;
-	struct addrinfo	*ai = NULL, hints;
+	struct addrinfo	*ai = NULL, hints, *current_ai;
 	struct addrinfo	*ai_bind = NULL;
 	char		service[8], *error = NULL;
 	void		(*func_socket_close)(zbx_socket_t *s);
@@ -508,52 +508,75 @@ static int	zbx_socket_create(zbx_socket_t *s, int type, const char *source_ip, c
 		goto out;
 	}
 
-	if (ZBX_SOCKET_ERROR == (s->socket = socket(ai->ai_family, ai->ai_socktype | SOCK_CLOEXEC, ai->ai_protocol)))
+	for (current_ai = ai; NULL != current_ai; current_ai = current_ai->ai_next)
 	{
-		zbx_set_socket_strerror("cannot create socket [[%s]:%hu]: %s",
-				ip, port, strerror_from_system(zbx_socket_last_error()));
-		goto out;
-	}
+		if (ZBX_SOCKET_ERROR == (s->socket = socket(current_ai->ai_family, current_ai->ai_socktype | SOCK_CLOEXEC, current_ai->ai_protocol)))
+		{
+			zbx_set_socket_strerror("cannot create socket [[%s]:%hu]: %s",
+					ip, port, strerror_from_system(zbx_socket_last_error()));
+			goto out;
+		}
 
-#if !defined(_WINDOWS) && !SOCK_CLOEXEC
-	if (-1 == fcntl(s->socket, F_SETFD, FD_CLOEXEC))
-	{
-		zbx_set_socket_strerror("failed to set the FD_CLOEXEC file descriptor flag on socket [[%s]:%hu]: %s",
-				ip, port, strerror_from_system(zbx_socket_last_error()));
-	}
-#endif
-	func_socket_close = (SOCK_STREAM == type ? zbx_tcp_close : zbx_udp_close);
+	#if !defined(_WINDOWS) && !SOCK_CLOEXEC
+		if (-1 == fcntl(s->socket, F_SETFD, FD_CLOEXEC))
+		{
+			zbx_set_socket_strerror("failed to set the FD_CLOEXEC file descriptor flag on socket [[%s]:%hu]: %s",
+					ip, port, strerror_from_system(zbx_socket_last_error()));
+		}
+	#endif
+		func_socket_close = (SOCK_STREAM == type ? zbx_tcp_close : zbx_udp_close);
 
-	if (NULL != source_ip)
-	{
-		memset(&hints, 0x00, sizeof(struct addrinfo));
+		if (NULL != source_ip)
+		{
+			memset(&hints, 0x00, sizeof(struct addrinfo));
 
-		hints.ai_family = PF_UNSPEC;
-		hints.ai_socktype = type;
-		hints.ai_flags = AI_NUMERICHOST;
+			hints.ai_family = PF_UNSPEC;
+			hints.ai_socktype = type;
+			hints.ai_flags = AI_NUMERICHOST;
 
-		if (0 != getaddrinfo(source_ip, NULL, &hints, &ai_bind))
-		{
-			zbx_set_socket_strerror("invalid source IP address [%s]", source_ip);
-			func_socket_close(s);
-			goto out;
+			if (0 != getaddrinfo(source_ip, NULL, &hints, &ai_bind))
+			{
+				zbx_set_socket_strerror("invalid source IP address [%s]", source_ip);
+				func_socket_close(s);
+				goto out;
+			}
+
+			if (ZBX_PROTO_ERROR == zbx_bind(s->socket, ai_bind->ai_addr, ai_bind->ai_addrlen))
+			{
+				zbx_set_socket_strerror("bind() failed: %s", strerror_from_system(zbx_socket_last_error()));
+				func_socket_close(s);
+				goto out;
+			}
 		}
 
-		if (ZBX_PROTO_ERROR == zbx_bind(s->socket, ai_bind->ai_addr, ai_bind->ai_addrlen))
+		if (SUCCEED != zbx_socket_connect(s, current_ai->ai_addr, (socklen_t)current_ai->ai_addrlen, timeout, &error))
 		{
-			zbx_set_socket_strerror("bind() failed: %s", strerror_from_system(zbx_socket_last_error()));
+			char	buffer[MAX_STRING_LEN] = {0};
+
+			switch(current_ai->ai_addr->sa_family) {
+				case AF_INET:
+					inet_ntop(AF_INET, &(((struct sockaddr_in *)current_ai->ai_addr)->sin_addr), buffer, sizeof(buffer));
+					break;
+				case AF_INET6:
+					inet_ntop(AF_INET6, &(((struct sockaddr_in *)current_ai->ai_addr)->sin_addr), buffer, sizeof(buffer));
+					break;
+				default:
+					buffer[0] = '\0';
+					break;
+			}
+
 			func_socket_close(s);
-			goto out;
+			zbx_set_socket_strerror("cannot connect to [[%s][%s]:%hu]: %s", ip, buffer, port, error);
+			zbx_free(error);
+
+			zabbix_log(LOG_LEVEL_INFORMATION, "%s", zbx_socket_strerror());
 		}
+		else
+			break;
 	}
 
-	if (SUCCEED != zbx_socket_connect(s, ai->ai_addr, (socklen_t)ai->ai_addrlen, timeout, &error))
-	{
-		func_socket_close(s);
-		zbx_set_socket_strerror("cannot connect to [[%s]:%hu]: %s", ip, port, error);
-		zbx_free(error);
+	if (NULL == current_ai)
 		goto out;
-	}
 
 #if defined(HAVE_GNUTLS) || defined(HAVE_OPENSSL)
 	if (NULL != ip && SUCCEED != is_ip(ip))
