Hetzner ubuntu dns resolution not working


I created a natgateway using opnsense

I created a VM in a private network which is behind the natgateway so that all internet traffic will pass through opensense into the client VM

I can ping google ip ( through opnsense which works fine

but I can't ping the domain name www.google.com and also I can't update OS using apt update

I get error this

temporary failure in name resolution

I am using hetzner cloud provider for VMs

the archecture of hetzner is that de default gateway take the first ip address since servers are not connected directly. The flow is like this (client server > gateway > opnsense)

Interface config on the client VM


auto lo
iface lo inet loopback
auto enp7s0
iface enp7s0 inet dhcp
   post-up ip route add default via

IP address

opnsense router

enter image description here

Best Answer

I edited this file /etc/systemd/resolved.conf and added dns

Related Topic