Try this DNS ...
Open System Preferences > Network > Advanced > DNS
Click + and type:
Click + again and do the same.
Quit and relaunch Safari to test. Try loading a webpage.
If that doesn't help, go to Safari > Preferences then select the Advanced tab.
Click: Change Settings next to: Proxies:
That will open the System Preferences > Network > Proxies window.
Deselect any checked boxes on the left, quit and relaunch Safari. Try loading a webpage.