Disable IPV6 in Ubuntu 18.04

IPV6 sometimes break DNS resolution in Ubuntu 18.04. Follow the steps below to disable and verify that IPV6 is disabled in Ubuntu.

Edit /etc/sysctl.conf and add the following lines to the end of the file …

net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
net.ipv6.conf.lo.disable_ipv6 = 1

Save the file and issue the following command to force Ubuntu to reload the file.

sysctl -p

To verify that the new configuration has been applied, you can issue the next command.

cat /proc/sys/net/ipv6/conf/all/disable_ipv6

You should receive a result of 1 if it was successfully applied and 0 if it failed.