Macbook pro 15″, late 2013: internet stopped working

wifi

I have a macbook pro 15", late 2013 with Catalina (10.15.4). It was working flawlessly until few hours ago, now internet won't work. I can't find any trace of hardware issue, the wifi card works fine and it connects to wifi networks. Unfortunately even with full signal internet doesn't work, even pinging from the terminal return the "unknown host" error. I don't have the ethernet adapter so I can't test it.

I tried different wifi networks, I tried forgetting the networking and connecting to it again, I have tried the wireless diagnostic, rebooting the laptop…no results so far…is there something else I can do?

EDIT: to add some context, I know that the wifi is working fine because two other computers and the phone have internet access via the same wifi network

EDIT: output of the command ipconfig getpacket en0 | grep "yiaddr\|router":

yiaddr = 192.168.1.63
router (ip_mult): {192.168.1.254}

EDIT: result of the various pings:

ping 192.168.1.254

PING 192.168.1.254 (192.168.1.254): 56 data bytes
64 bytes from 192.168.1.254: icmp_seq=0 ttl=64 time 1.891ms
...

it seems to work, same thing for ping 8.8.8.8:

PING 8.8.8.8 (8.8.8.8): 56 data bytes
64 bytes from 8.8.8.8: icmp_seq=0 ttl=64 time 9.997ms
...

sadly, ping www.google.com still results in ping: cannot resolve www.google.com: Unknown host

Best Answer

Thanks to Allan I found the answer. I had to change my dns with the following command:

networksetup -setdnsservers Wi-Fi 8.8.8.8 8.8.4.4

after that internet was back!