Could not resolve packagist.org host

Since a few days ago I often get the following error while installing composer packages:

The "http://repo.packagist.org/p/drush/drush%2451e4d8a96971d82ee67b0b769603435556510b787bc22d846219e0a5d3981ed3.json" file could not be downloaded: failed to open stream: Operation timed out
Retrying with degraded mode, check https://getcomposer.org/doc/articles/troubleshooting.md#degraded-mode for more info
                                                                                                                                                                                                                           
  [Composer\Downloader\TransportException]                                                                                                                                                                                 
  The "http://repo.packagist.org/p/drush/drush%2451e4d8a96971d82ee67b0b769603435556510b787bc22d846219e0a5d3981ed3.json" file could not be downloaded: php_network_getaddresses: getaddrinfo failed: Name does not resolve  
  failed to open stream: php_network_getaddresses: getaddrinfo failed: Name does not resolve                                                                                                                                                                                                                                                                                                                  

Build https://travis-ci.org/wodby/drupal-php/jobs/568092230

Related topic Travis Network Timeout Issue

I see travis team is now aware of this issue https://www.traviscistatus.com/