There are two sets of things to do.
--------
on Public networks, you typically need to get a login page and enter some information about yourself before you get access. If you enter the symbolic name or any web-site names, DNS (internet name-to-number lookup) may be blocked, and access is blocked because you did not use the login page. You are not allowed to look up the web-site names because you are not authorized.
so launch a Browser and enter:
1.1.1.1
in the search bar and press return.
If you get the [intercepted] public network login page, you are on your way to successful connection.
The address is owned by CloudFlare, which is not part of the solution, they just have the easiest-to-remember numeric IP address that is answered with their splash page.
--------
The other thing is that you may need do is to start over with default network settings. You do that by creating a NEW, NAMED Location (DON'T use the default, that will not allow you to start over!):
How to use network locations on your Mac - Apple Support