curl: (7) Failed to connect to port 80, and 443 – on one domain

Issue

This question shows research effort; it is useful and clear

I have checked the cURL not working properly

When I run the command curl -I https://www.example.com/sitemap.xml

curl: (7) Failed to connect

Failed to connect on all port

this error only on one domain, all other domain working fine, curl: (7) Failed to connect to port 80, and 443

Thanks…

Solution

After many search, I found that Hosts settings not correct

Then I check nano /etc/hosts
The Domain point to wrong IP in hosts file

I change the wrong IP and its working Fine

This is new error Related to curl: (7) Failed to connect

Answered By – Mitra

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published