This is sincerely not only case of connectivity switching, first it happens if you don't enlist INTERNET permission, second, the DNS or data-flow on the way can be corrupted somehow, and this shouldn't drive you into more than 2-3 tries to resolve.