Ubuntu 18.04 cannot ping or nslookup outside the LAN.

When I do nslookup www.google.comit hangs for a while and returns ;; connection timed out; no servers could be reachedI cannot ping www.google.com but I can ping, my gateway. The server is using netplan. When I do a netplan apply, I don't get errors. Here is my netplan config file.

  version: 2
            dhcp4: no
            dhcp6: no
            addresses: []
               addresses: [,]

Here is my resolv.conf:


I can't install apps because it cannot resolve DNS.

This is an image from a ESXI implementation. Other images in the network respond to all network requests except this linux client.

  • Show not a configuration file but ip addr and ip route from the running system. Last should display a line similar to default via dev ens160; try ping (or whatever your actual default route is) and see if that works. Jun 7 at 7:38
  • And check if there is a firewall blocking your outbound requests.
    – bjoster
    Jun 16 at 14:55

1 Answer 1


It was related to the firewall, there are two types of NAT that can be figured on the firewall: 1 to 1 with Nat, or 1 to many with NAT.

What worked was 1 to many with NAT.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .