'Error with symfony : You have misconfigured DNS resolver(s)

When I run the command composer install or composer update it shows me the following

The following exception probably indicates you have misconfigured DNS resolver(s)
                                                                                                                
  [Composer\Downloader\TransportException]                                                                         
  curl error 6 while downloading https://flex.symfony.com/versions.json: Could not resolve host: flex.symfony.com`

I changed DNS but that did not fix the problem.

PHP version : 8.0.0. I test with php version 7.4



Solution 1:[1]

This fixed it for me:

composer update symfony/flex --no-plugins --no-scripts

source: https://symfony.com/blog/upgrade-flex-on-your-symfony-projects

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 qwertz