I set router back to factory settings.You are not listening. Did you change DNS settings on your machine or router?
there are many public DNS servers. Your ISP's DNS probably is not working well.
Some public DNS list:
Cloudflare - 1.1.1.1
8.8.8.88.8.4.4Cloud9 - 9.9.9.9
and the Adguard DNS mentioned above.