I would bet a hundred bucks that 192.168.1.254 is your gateway. You can confirm by running the
ip route command:
λ ip route
default via 192.168.0.1 dev eno1 proto dhcp src 192.168.0.2 metric 100
192.168.0.0/24 dev eno1 proto kernel scope link src 192.168.0.2 metric 100
default via" value will identify your gateway (in my case the gateway is 192.168.0.1).
It is perfectly common for your gateway to assign a DNS server for devices on your network, but in this case it looks like something is misconfigured somehow--it should be assigning an actual DNS server, not itself.
The first thing I would try is simply rebooting your router (I am assuming your router is your gateway). If you can, just unplug it from power, wait ten seconds or so, then plug it back in. Then reboot your computer too, and see if the gateway is still setting itself as the DNS server.
If it is, you should figure out how to log in to the admin portal for your router so you can examine the settings. Typically you would navigate to the IP address of your router in a web browser (just type 192.168.1.254 in the address bar) and log in. If you have never logged in before, do a web search for your router model to find out what you are supposed to be using for the default credentials.
Somewhere in the settings you should be able to change the DNS servers, or at least see what they are set to. They might refer to them as DNS servers or Name Servers, and it might be stuck in various places in the settings. My DNS servers can be configured in Gateway > Connection > Local IP Network > IPv4, but every router does this a little differently. You might have to poke around a little bit to find it.
Once you find it, add the DNS servers you want to use for the primary and secondary DNS servers. I typically use OpenDNS because it works well and I appreciate the configuration that can be done in their web portal.
Obviously feel free to use any DNS servers you want.
My guess is your router is configured with IPv6 nameservers, and perhaps an IPv4 nameserver is not configured by default. By disabling IPv6 the gateway is no longer able to pass along the nameserver.
It is pretty common for ISPs to have IPv6 nameservers that they send down to their subscribers by default (it helps them examine your network traffic ). Depending on your ISP these nameservers are often not great anyway, so getting in there and fixing the settings is probably for the best.