The validation of failed with an exception "cURL error 6: Could not resolve host (HTTP code 0)

We have Matomo statistics on the subdomain[.]domain[.]com. We want to connect the second different webste.com to statistics to subdomain[.]domain[.]com. After entering the correct data in the plugin in Drupal 8, there is a following error code:

Hi,

It seems like the server where drupal is running can’t connect to the domain where Matomo is running.

Can you make sure that it can reach the internet and the Matomo domain is reachable?