Sounds like you have an interesting failure! It wasn't clear if your phone is using the same router and WiFi. Are you sure your phone is on the same WiFi? (vs. using cellular data to get to the net).
Some things I'd try:
(1) turn off cell-data on your phone (to force it to use WiFi) and see if it's still able to use the web. It could be the phone is using cellular to get to the net and not using your router (or your normal DNS servers) at all.
(2) Try power cycling your router (off, wait a minute, on). It might be the domain name service on your router that is failing (or maybe something with the NAT engine). A swift kick (er, power cycle) might be all that's needed.
(3) As Make7 suggested, try connecting to your router .. but be sure and put "http://" before the IP address of the router. The address you should see & use will likely be something like "192.168.0.1" or "10.0.1.1". Oh, and don't bother with this step if you have an old Apple branded WiFi base station ... they didn't use use normal web interfaces to configure. Almost all other routers (base stations) used web interfaces and should at least give you a login page.
(4) As a silly experiment, try connecting to the web site "http://1.1.1.1" (remember to put in the "http://" before the "1.1.1.1" ). You should see a simple ad for Cloudflare's 1.1.1.1 product. This is one of the few public web sites I've found where you can connect to it's IP address instead of requiring a domain name. If this works (and the other sites don't), then it's a red-flag that your domain name service is busted and the next step would be to try and figure out why (and set it to something that works).
Hope this helps, or is at least entertaining.