Composer version: 2.0.4
OS: macOS 10.15.7
When I run composer diagnose I get DNS resolver issue as seen in the attached image
I am able to ping getcomposer.org, packagist.org, github.com - all sites from the terminal.
curl -i packagist.org -L also works as expected without any error
Yet with composer diagnose I am getting DNS resolver issue
This started happening after I upgraded PHP from 7.4.1 to 7.4.12 and updating to composer 2
What could be the issue and how can I fix it
As searchable text code - composer 2.0.4 diagnose failing
$ composer diagnose
Checking platform settings: OK
Checking git settings: OK
Checking http connectivity to packagist: FAIL
The following exception probably indicates you have misconfigured DNS resolver(s)
[Composer\Downloader\TransportException] Resolving timed out after 10003 milliseconds
Checking https connectivity to packagist: FAIL
The following exception probably indicates you have misconfigured DNS resolver(s)
[Composer\Downloader\TransportException] Resolving timed out after 10003 milliseconds
Checking github.com rate limit: FAIL
[Composer\Downloader\TransportException] Resolving timed out after 10004 milliseconds
Checking disk free space: OK
Checking pubkeys:
Tags Public Key Fingerprint: 57815BA2 7E54DC31 7ECC7CC5 573090D0 87719BA6 8F3BB723 4E5D42D0 84A14642
Dev Public Key Fingerprint: 4AC45767 E5EC2265 2F0C1167 CBBB8A2B 0C708369 153E328C AD90147D AFE50952
OK
Checking composer version: FAIL
[Composer\Downloader\TransportException] Resolving timed out after 10002 milliseconds
Composer version: 2.0.4
PHP version: 7.4.12
PHP binary path: /usr/local/Cellar/php/7.4.12/bin/php
OpenSSL version: OpenSSL 1.1.1h 22 Sep 2020
cURL version: 7.73.0 libz 1.2.11 ssl OpenSSL/1.1.1h
zip extension: OK
Screenshot - composer 2.0.4 diagnose failing

I just uninstalled composer 2.0.4 and installed composer 1.10.17 with rest of the packages/apps as it is and it runs without any DNS resolver error
As searchable text code composer 1.10.17 diagnose
composer diagnose
Checking platform settings: OK
Checking git settings: OK
Checking http connectivity to packagist: OK
Checking https connectivity to packagist: OK
Checking github.com rate limit: OK
Checking disk free space: OK
Checking pubkeys:
Tags Public Key Fingerprint: 57815BA2 7E54DC31 7ECC7CC5 573090D0 87719BA6 8F3BB723 4E5D42D0 84A14642
Dev Public Key Fingerprint: 4AC45767 E5EC2265 2F0C1167 CBBB8A2B 0C708369 153E328C AD90147D AFE50952
OK
Checking composer version: You are not running the latest stable version, run `composer self-update` to update (1.10.17 => 2.0.4)
Composer version: 1.10.17
PHP version: 7.4.12
PHP binary path: /usr/local/Cellar/php/7.4.12/bin/php
OpenSSL version: OpenSSL 1.1.1h 22 Sep 2020
Screenshot - composer 1.10.17 diagnose

So does it mean that composer 2.0.4 has some issues? or is incompatible with my setup of other apps/packages?
I want to use composer 2.x, so what do I do to make it work?
