Manjaro cannot access the Internet, a dns error may occur, how to fix it ,

I can’t get online through my browser,When I ping ip, there is a reply, but when I ping the domain names, there is no reply.

The contents of my /etc/resolv.conf file are as follows

# Generated by NetworkManager

When I modify to nameserver, everything works fine.

But after restarting, it will automatically restore to nameserver

I don’t want to modify /etc/resolv.conf, how can I do

The DHCP service provides the gateway, network and DNS server.

Don’t fiddle with network configuration unless you know what you are doing.

When the DNS server provided by your network’s DHCP server is not functional then you need to ensure the DHCP server has the correct configuration.

If you have changed DNS using Network Manager GUI - you will to undo the changes.

Hint is in there, where you have to change it. Or if that’s your router then enable/fix dns in it.

Your providers DNS might not be working temporarily.
To use your own, you can change that either in your router directly (it’s web configuration pages)
which will affect all devices connected through that router

or you go through NetworkManager.
which will only affect this one particular computer

In the GUI, you select the 5th tab (IPv4 Settings)
and change “Automatic (DHCP)” to “Automatic (DHCP), Addresses only”
and put your custom nameserver in the DNS Server field below.

Maybe do the same for IPv6 - or disable it …