1

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.

Cas
  • 562

1 Answers1

0

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.

Nmath
  • 12,333
  • @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. – Nate T Oct 10 '21 at 13:36
  • 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. – Cas Oct 10 '21 at 16:52