Factory resetting is unlikely to help as it's a networking problem, not an issue with the Switch itself, so please don't be concerned. Check out the article I linked from Nintendo and try the troubleshooting steps for error code 2809-1028.
To reassure you, there is no known browser virus targeting the Switch in the last several years, and changing DNS settings is a supported and normal feature of many Internet-enabled devices. The Switch also has many security features to ensure that the software it runs will not be modified, and the browser itself receives modern security updates.
I suggest you set your DNS to 8.8.8.8 or try another Internet access hotspot so you can confirm to yourself that it isn't an issue with the Switch. If it's truly a networking glitch, it will probably resolve itself as time continues (the Nintendo article mentions this too).
To clarify one more time: The browser popping up is not an exploit or a hack, and is instead is an intended use case for logging into hotel and airplane wifi networks. The only difference is our DNS server redirects you to Google instead of an internal captive portal.
As for accessing Google on Switch, using a DNS override (like browsedns or switchbru dns) is the only option at this time. If that's now not working, make sure that the redirect is enabled at the lanechange URLs I provided. We want Nintendo to add a browser in the future though! Then we would not need to rely on networking configs to access the Internet.
There are some more troubleshooting steps you can do with a computer, outlined on our FAQ: https://faq.fortheusers.org/#troubleshooting-1 But in general, if it is an issue with your ISP (Internet Service Provider), you would either have to wait, or contact them. I have helped a user in the past check with their ISP and confirm that the ISP's DNS was improperly caching the browser, and they were able to issue a reset remotely.
You might also have luck changing your DNS settings directly on your router: https://www.avast.com/c-how-to-change-router-dns-settings If you'd like to talk through this more specifically with your model router, we can chat over DM.