Opening Firefox or running sudo apt update in Ubuntu only to sit staring at “Resolving host…” or “Connecting…” for ten full seconds before pages suddenly load normally – even while your phone and Windows laptop on the exact same Wi-Fi fly instantaneously – is a classic Linux networking snag. Many home ISP routers advertise partial or broken IPv6 support; Ubuntu dutifully tries IPv6 first on every click and waits for a long timeout before falling back to fast IPv4.
Step 1: Confirm Whether IPv6 Timeouts Are Causing Your Slowdown (Takes 10 Seconds)
Before changing any network configuration, run two quick tests in Terminal to confirm whether IPv6 is the bottleneck.
- Open Terminal by pressing Ctrl + Alt + T.
- Compare forcing IPv4 versus standard automatic connection (which tries IPv6 first):
curl -4 -o /dev/null -s -w "IPv4 time: %{time_total}s " https://ubuntu.com curl -6 -o /dev/null -s -w "IPv6 time: %{time_total}s " https://ubuntu.com - If
IPv4 timeprints0.3swhileIPv6 timehangs for 10-30 seconds or prints0.000s(timed out / unreachable), broken router IPv6 routing is slowing down every browser lookup and package update.
Fix 1: Disable IPv6 Cleanly for Your Current Wi-Fi or Ethernet Network (Recommended)
Instead of breaking IPv6 globally across VPNs or local Docker containers, Ubuntu lets you turn IPv6 off strictly on your problematic home or office Wi-Fi connection straight in Settings.
- Click the top-right system tray in Ubuntu and open Settings > Network (or Settings > Wi-Fi).
- Click the gear icon beside your active Wi-Fi or Wired network name.
- Switch to the IPv6 tab along the top of the connection window.
- Select Disable (instead of Automatic) and click Apply.
- Toggle your Wi-Fi or Wired connection off and back on once so NetworkManager drops stale IPv6 routes immediately.
Fix 2: Force APT Package Updates to Prefer IPv4 Over Broken IPv6
If browsing feels fine yet sudo apt update and sudo apt upgrade constantly hang for minutes on Connecting to archive.ubuntu.com, tell Ubuntu’s package manager specifically to use IPv4:
- Test forcing IPv4 once:
sudo apt -o Acquire::ForceIPv4=true update - If packages download at full broadband speed right away, make that preference permanent for
aptwithout touching your browser networking:echo 'Acquire::ForceIPv4 "true";' | sudo tee /etc/apt/apt.conf.d/99force-ipv4
Fix 3: Check Custom DNS Speed (Switch to Fast Local or Cloudflare/Google DNS)
Occasionally ISP routers forward DNS queries slowly regardless of IPv6. Inside that same Settings > Wi-Fi > Gear Icon > IPv4 tab, turn off Automatic DNS and enter reliable fast resolvers such as 1.1.1.1, 8.8.8.8, click Apply, and reconnect your Wi-Fi cleanly (see also how to forget and re-add stale Wi-Fi profiles in Ubuntu Settings if old network caches persist).