I'm using Ubuntu 18.04 Server and trying to make a router. When I execute the following iptables script (which worked just perfectly on Ubuntu 16.04), the DNS lookup from command line stops working. I have ping to IP addresses, but no DNS names. Something is obviously changed from 16.04, but don't know what.
EDIT: I started executing lines one by one and defined the culprit is this:
iptables -t nat -A POSTROUTING -j MASQUERADE
But still don't know why (it worked on previous Ubuntu versions - 16.04, 14.04, 12.04)
The ping output is:
# ping google.com ping: google.com: Temporary failure in name resolution
If I reboot WITHOUT this script, it works:
# ping google.com PING google.com (184.108.40.206) 56(84) bytes of data. 64 bytes from sof02s32-in-f14.1e100.net (220.127.116.11): icmp_seq=1 ttl=57 time=2.92 ms