Server lost connection to internet

Hi!
Couple days ago I so that one of my servers lost connection with the internet.
My specs:
Debian 12 server running in a Proxmox VM
I tried to ping local servers / router, got result.
Tried to ping 8.8.8.8, got result.
Tried to ping google.com, well… “temp. failure in name resolution”.
Tried to ping google.com’s ip: 142.251.214.142, got result.
So something with dns resolution?
Can you guys help me?

cat /etc/resolv.conf

If you see it set to 127.0.0.1 or 127.0.0.53, then:

cat /etc/systemd/resolved.conf

See if the server you’re using is available. You might have luck with:

systemctl restart resolved
systemctl restart systemd-resolved

(I don’t remember if it’s called resolved or systemd-resolved, one of these)

You might have confs in /etc/systemd/resolved.conf.d/*.conf, which tell you the DNS server you’re using.

If all else fails, install nslookup and run:

nslookup google.com 8.8.8.8

This will look up the IP of google.com using the DNS server 8.8.8.8. If it works, then you’ve gotta change the DNS settings of your Debain 12 server.

Thank you for your answer!
Okay, /etc/resolv.conf gives me:

nameserver 192.168.0.1
nameserver 192.168.0.1

This server lost connection to internet around the time when I changed subnet mask in my LAN from /24 to /8. Router have had ip address: 192.168.0.1, now it’s 10.0.0.1. So should I change it? Also why is that line duplicated?

I tried to run cat /etc/systemd/resolved.conf but I don’t have anything of the kind:

oot@nextcloud:~# ls -l /etc/systemd/
total 44
-rw-r--r--  1 root root 1282 Jan 26  2024 journald.conf
-rw-r--r--  1 root root 1539 Jan 26  2024 logind.conf
drwxr-xr-x  2 root root 4096 Jan 26  2024 network
-rw-r--r--  1 root root  846 Jan 26  2024 networkd.conf
-rw-r--r--  1 root root  670 Jan 26  2024 pstore.conf
-rw-r--r--  1 root root  953 Jan 26  2024 sleep.conf
drwxr-xr-x 12 root root 4096 Sep 15 04:02 system
-rw-r--r--  1 root root 2080 Jan 26  2024 system.conf
-rw-r--r--  1 root root  864 Jan 26  2024 timesyncd.conf
drwxr-xr-x  3 root root 4096 Jun  5 21:19 user
-rw-r--r--  1 root root 1415 Jan 26  2024 user.conf
root@nextcloud:~# 

Also I don’t have these units:

root@nextcloud:~# systemctl status resolved
Unit resolved.service could not be found.
root@nextcloud:~# systemctl status systemd-resolved
Unit systemd-resolved.service could not be found.
root@nextcloud:~# 

nslookup however works.

What should I do now?

Edit /etc/resolv.conf and change 192.168.0.1 to 10.0.0.1. You can put the 2nd entry there to 8.8.8.8 to use google dns.

It works! Thank you.