DNS doesn't work, though I can ping it. Adding a new one can solve the problem temporarily.
I have a 14-inch Macbook Pro released in 2021, recently my DNS failed regularly, the problem is as follows: my current DNS to Google DNS(8.8.8.8), it worked for about 24 hours after startup, then failed. But I could still ping my DNS server(the Google DNS). At this stage, I had to add another DNS that I had not used after startup, say DNS provided by Alibaba(223.5.5.5). Then, it worked for around another 24 hours before failing again. However, my network was still in good condition as I could still ping servers by IP addresses (but both aforementioned DNS were malfunctioning). As you see, the peculiar scenarios repeated. I wonder what is the problem with my computer or OS and what is a more elegant solution instead of continuously adding new DNS.
MacBook Pro 14″, macOS 12.0