Score:1

Ubuntu server suddenly doesn't have access to outside of the network anymore

in flag
Cas

I have a server with TrueNAS Core installed and an Ubuntu server vm running on it. I rebooted the vm and now suddenly it can't reach the outside. When I do ping www.google.com, it says ping: www.google.com: Temporary failure in name resolution. When I do ping 172.217.168.196, it works. So the dns part isn't working. When I do cat /etc/netplan/00-installer-config.yaml, this is the output:

# This is the network config written by 'subiquity'
network:
  ethernets:
    enp0s4:
      addresses:
      - 192.168.2.15/24
      gateway4: 192.168.2.1
      nameservers:
        addresses:
        - 1.1.1.1
        search: []
  version: 2

I've tried it with ufw disabled, and with the nameserver changed to 192.168.2.15 (the pihole + unbound running on the vm). Both didn't help. However, my win10 computer also uses the pihole as it's dns server and my win10 computer works fine. I'm also running an openvpn server on it and the clients can also reach www.google.com fine (the dns server for the clients is also set as the pihole). ping 1.1.1.1 did work; just wanted to make sure cloudflare didn't have a malfunction.

So it has to do specifically with the server itself, as all other clients and such that use the server work fine. However I just don't know what to do anymore.

David avatar
cn flag
What version of Ubuntu?
Cas avatar
in flag
Cas
Ubuntu server 20.04.3 LTS focal
Nate T avatar
it flag
can you install `nmcli` from apt and post the output of the command itself: `nmcli`?
Nate T avatar
it flag
Your **dns** is out somehow. please post the output of `cat /etc/resolv.conf` as well. If I can see these two, I should be able to help
Score:0
fr flag

Try vi /etc/resolv.conf and add nameserver 1.1.1.1

I was having the same issue with Ubuntu server VMs and that fixed it. I'm not sure how to make it persistent after a reboot though.

Nate T avatar
it flag
@Cas `sudo echo 'nameserve 1.1.1.1' >> /etc/resolv.conf ` will accomplish the same. It will save you having to open / close the vim buffer. You will need to use sudo or su to write to the /etc directory either way.
Cas avatar
in flag
Cas
It does work but it indeed only works until reboot. After reboot, the file `/etc/resolv.conf` is reset. I can ofcourse just add a `@reboot ...` to crontab, but I want to fix it properly. I found the file `/etc/systemd/resolved.conf` where I can set `DNS=1.1.1.1` but that doesn't work.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.