The internet relies on IP addresses to route data. While the classic IPv4 standard (e.g., 192.168.1.1) is still the dominant format globally, the newer IPv6 standard is slowly being adopted. By default, Ubuntu Linux will always attempt to negotiate an IPv6 connection first. If it fails, it gracefully falls back to IPv4.
However, if your internet service provider or your home router has a poorly configured IPv6 implementation, Ubuntu can get stuck in a “black hole.” The system will try to route DNS requests over IPv6, wait 30 seconds for the request to time out, and only then switch to IPv4. This results in websites loading incredibly slowly or failing to connect entirely. The fastest way to fix this networking nightmare is to completely block IPv6 at the kernel level and force Ubuntu to exclusively use IPv4.
How to Completely Block Ubuntu IPv6 Connections
You must edit the GRUB bootloader configuration to instruct the Linux kernel to disable the protocol.
- Open your Terminal application (Ctrl + Alt + T).
- Type the following command to open the GRUB configuration file in the nano text editor:
sudo nano /etc/default/grub - Type your administrator password when prompted.
- Look for the line that begins with
GRUB_CMDLINE_LINUX_DEFAULT=. It usually contains the words “quiet splash”. - You must add the IPv6 disable command inside those quotation marks. Modify the line so it looks exactly like this:
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash ipv6.disable=1" - Press Ctrl + O to save the file, press Enter to confirm, and then press Ctrl + X to exit the nano editor.
- Because you modified the bootloader, you must update GRUB for the changes to take effect. Type this command and press Enter:
sudo update-grub
The terminal will quickly generate a new boot configuration. Restart your computer. When Ubuntu boots back up, the kernel will completely refuse to load the IPv6 networking stack. All of your internet traffic, software updates, and DNS requests will be instantly forced over the stable, ultra-reliable IPv4 protocol.