# Server lost connection to internet

**URL:** <https://community.learnlinux.tv/t/server-lost-connection-to-internet/4158>\
**Category:** Virtualization\
**Created:** [September 14, 2024, 7:00pm UTC](https://community.learnlinux.tv/t/server-lost-connection-to-internet/4158 "2024-09-14T19:00:43Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![kazimierzkrauze](https://community.learnlinux.tv/letter_avatar_proxy/v4/letter/k/898d66/32.png) [@kazimierzkrauze](https://community.learnlinux.tv/u/kazimierzkrauze)\
**Post date:** [September 14, 2024, 7:00pm UTC](https://community.learnlinux.tv/t/server-lost-connection-to-internet/4158/1 "2024-09-14T19:00:43Z")

</div>

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](http://google.com), well… “temp. failure in name resolution”.  
Tried to ping [google.com](http://google.com)’s ip: 142.251.214.142, got result.  
So something with dns resolution?  
Can you guys help me?

---

<div class="post-metadata">

**Author:** ![ThatGuyB](https://community.learnlinux.tv/user_avatar/community.learnlinux.tv/thatguyb/32/784_2.png) [@ThatGuyB](https://community.learnlinux.tv/u/ThatGuyB)\
**Post date:** [September 14, 2024, 11:42pm UTC](https://community.learnlinux.tv/t/server-lost-connection-to-internet/4158/2 "2024-09-14T23:42:17Z")

</div>

```auto
cat /etc/resolv.conf

```

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

```auto
cat /etc/systemd/resolved.conf

```

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

```auto
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:

```auto
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.

---

<div class="post-metadata">

**Author:** ![kazimierzkrauze](https://community.learnlinux.tv/letter_avatar_proxy/v4/letter/k/898d66/32.png) [@kazimierzkrauze](https://community.learnlinux.tv/u/kazimierzkrauze)\
**Post date:** [September 15, 2024, 9:19am UTC](https://community.learnlinux.tv/t/server-lost-connection-to-internet/4158/3 "2024-09-15T09:19:29Z")

</div>

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

```auto
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:

```auto
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:

```auto
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?

---

<div class="post-metadata">

**Author:** ![ThatGuyB](https://community.learnlinux.tv/user_avatar/community.learnlinux.tv/thatguyb/32/784_2.png) [@ThatGuyB](https://community.learnlinux.tv/u/ThatGuyB)\
**Post date:** [September 15, 2024, 3:49pm UTC](https://community.learnlinux.tv/t/server-lost-connection-to-internet/4158/4 "2024-09-15T15:49:13Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![kazimierzkrauze](https://community.learnlinux.tv/letter_avatar_proxy/v4/letter/k/898d66/32.png) [@kazimierzkrauze](https://community.learnlinux.tv/u/kazimierzkrauze)\
**Post date:** [September 15, 2024, 7:54pm UTC](https://community.learnlinux.tv/t/server-lost-connection-to-internet/4158/5 "2024-09-15T19:54:47Z")

</div>

It works! Thank you.
