Need help with DNS nameserver

So I was using my old Android Go Tablet as my wifi router, with cellular 4G network.
Unfortunately the tablet got bricked due to some water.
So I put the SIM card in old android phone for now, as I have a week or two when I actual router.

The issue I am having with this phone is that it is providing the internet gateway but has some sort of a DNS issue. By default the PC reports no internet connection, I did some tests with APN type and other network settings on the phone but nothing happened.

Thankfully I noticed that the KDE connect was doing its stuff on LAN properly between the two devices, so it was definitely some internet related problem.
So I tested pings and stuff from the PC.

❯ ping -c 4 1.1.1.1
PING 1.1.1.1 (1.1.1.1) 56(84) bytes of data.
64 bytes from 1.1.1.1: icmp_seq=1 ttl=56 time=67.9 ms
64 bytes from 1.1.1.1: icmp_seq=2 ttl=56 time=66.3 ms
64 bytes from 1.1.1.1: icmp_seq=3 ttl=56 time=55.6 ms
64 bytes from 1.1.1.1: icmp_seq=4 ttl=56 time=70.7 ms

--- 1.1.1.1 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3005ms
rtt min/avg/max/mdev = 55.643/65.111/70.693/5.692 ms

but pinging a site name like google.com was returning some error.

So I added this line to resolv.conf

#opening the file
❯ sudo fresh /etc/resolv.conf 

#the line I added to the end
nameserver 1.1.1.1

And suddenly all the online services came to life.
which is good, I think this is just a DNS address of Cloudflare, google’s is 8.8.8.8
So the laptop is sending raw data to phone to pass over, which is working.

The problem I am facing is everytime the laptop disconnects from the phone hotspot, like when went to sleep or there is an network disconnect for some reason, the line I added is erased/overwritten.
This I think is default behaviour on connection to any network.

So I was trying to solve this, I went to the network configuration settings → IPv4 → Method and changed it from Automatic to Automatic (Only Addresses) and put 1.1.1.1 into DNS Servers (didnt put 8.8.8.8 just yet)
Hit Apply, hoping it’ll be permanently remembered now, bit it’s not being remembered.
By that I mean in that GUI settings the custom configuration is there but its not written to that file.

Any Solutions how I can get this permanently done and/or if I should used 1.1.1.1 and/or 8.8.8.8 (Cloudflare/Google DNS rep) are there any issues with them?
I know it’s a Old Phone problem, just need temporary solution foe now.

I think one should not fiddle with /etc/resolv.conf because it may be rewritten by the network management tool.

You could try dropping a configuration in /etc/NetworkManager/conf.d. I just used the information from the man-page - so I do not know if it is correct - please verify.

10-dns-management.conf
[main]
dns=default
rc-manager=unmanaged

Then set your preferred DNS in /etc/resolv.conf however you like

nameserver 1.1.1.1 1.0.0.1 8.8.8.8

See the man-page man NetworkManager.conf

Yes. That is what I was looking for and its working!
I was just testing the solutions with /etc/resolv.conf etc, as you know I’m not much familiar with Linux based systems and core structures/utilities.

Thanks!