No, the backup only contains data. Sometimes wiping and restoring fixed weird problems like this, though.
Similar to what James suggested, you could try setting DNS manually in the WiFi settings on the iPhone iPad rather than using automatic. Settings / WiFi, tap the info button for your WiFi, scroll down a bit to Configure DNS. You can try Google’s dns at 8.8.8.8 and 8.8.4.4 or CloudFlare’s at 1.1.1.1 and 1.0.0.1 and see if charging dns servers help.
If you are seeing this only in Safari, you can try nuking the Safari history and cache with settings / safari / clear history and website data (I believe that was still the command in iOS 12). This will lose all of your login cookies so reconnecting to web sites will require logging in to the sites again for those that require it, but a step worth trying.