Your firewall may be blocking outbound HTTP requests. If you have a HTTP proxy (e.g., squid), you can configure the forward proxy as follows.
Edit your config/config.ini.php and add the following:

host =      ; Proxy host: the host name of your proxy server (mandatory)
port =      ; Proxy port: the port that the proxy server listens to. There is no standard default, but 80, 1080, 3128, and 8080 are popular
username =      ; Proxy username: optional; if specified, password is mandatory
password =      ; Proxy password: optional; if specified, username is mandatory

Once configured, Matomo (Piwik) will contact external hostnames using this proxy server.