Public Wi-Fi:
When using a public Wi-Fi you may need to use a login page and enter some access credentials to get online. The login page is presented when the local Access Point intercepts a web page request, and substitutes its own login page instead. Sometimes the login page does not appear, due to a diabolical problem with Domain Name Server DNS (internet telephone number) lookups. DNS lookups may also be blocked, so you can't get anywhere.
Launch a browser and enter this easy to remember all-numeric IP address:
1.1.1.1
in the address bar, and press return.
If in a Hotel or trying to access public Wi-Fi, and you get the local network login page, enter your credentials and proceed.
If you get the CloudFlare** splash page, your internet is working, but DNS lookup may not be working.
**CloudFlare is NOT part of the solution, they just own the easiest to remember all-numeric IP Address.
The reason attempts at web pages may not work in certain situation is that what your Mac tries first is a DNS server request (look up this “website.com” to an ‘all-numeric’ Internet Phone number), which is blocked because you have not logged on yet, so your actual web page request goes nowhere because your Mac can't determine where to send it.
Supplying an All numeric IP address Does go out, because it needs no DNS lookup. That gets intercepted and you get your local login page.