Thank you for visiting Apple Support Communities.
I would first start with processing the steps in the article below referring to resetting NVRAM / PRAM.
If the issue persists, try going through the steps in the article below.
Thanks for your reply.
I solved this problem by switching from DHCP to static IP address, selecting an IP address other than the one already assigned, then manually entering the Subnet Mask, Router, DNS Server, and Search Domains values. I also cleared checkboxes for Web Proxy and Secure Web Proxy.
Immediately, I was able to connect to the internet.
I then switched back to DHCP, to let the automated IP address thing happen, if necessary.