Wi-Fi Connected But No Internet: DNS or Gateway Issue?

You're connected to Wi-Fi but can't load any sites. This is usually a DNS or default gateway problem, not a hardware failure.

You're sitting at your desk, laptop shows full Wi-Fi bars, but nothing loads. Not even Google. You open ping 8.8.8.8 in a terminal — and it replies. But ping google.com fails with Name or service not known. That's the signature. You're connected to the local network but your device can't resolve domain names. The IP route works, but DNS is broken. Or sometimes even ping 8.8.8.8 fails, which means the default gateway itself is unreachable.

The root cause is almost always one of two things: DNS configuration got corrupted (often after switching networks, waking from sleep, or VPN disconnects), or the router's DHCP failed to hand out a valid default gateway. I've seen this happen when a hotel's captive portal times out, when a Windows update resets the network adapter, or when you run a VPN that doesn't clean up after itself.

Step 1: Confirm the actual problem

Open a terminal and run:

ping 8.8.8.8
ping google.com
  • If both fail: the issue is with the default gateway (your router). Skip to Step 3.
  • If 8.8.8.8 works but google.com fails: DNS is broken. Do Step 2.

Step 2: Fix DNS — the quick way

Set a public DNS server manually. I use 1.1.1.1 (Cloudflare) and 9.9.9.9 (Quad9). Google's 8.8.8.8 works too, but Cloudflare is faster in most regions.

On Windows 10/11

  1. Open Control Panel > Network and Sharing Center > Change adapter settings.
  2. Right-click your active Wi-Fi adapter, choose Properties.
  3. Select Internet Protocol Version 4 (TCP/IPv4) and click Properties.
  4. Choose Use the following DNS server addresses.
  5. Set Preferred to 1.1.1.1, Alternate to 9.9.9.9.
  6. Click OK, then close everything. Run ipconfig /flushdns in Command Prompt as admin.

On macOS (Sonoma, Ventura, etc.)

  1. Go to System Settings > Network > Wi-Fi > Details.
  2. Click DNS, remove any existing entries.
  3. Add 1.1.1.1 and 9.9.9.9.
  4. Click OK, then run sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder in Terminal.

On Linux (Ubuntu/Debian/Fedora with NetworkManager)

  1. Edit /etc/resolv.conf with sudo nano /etc/resolv.conf.
  2. Replace contents with:
    nameserver 1.1.1.1
    nameserver 9.9.9.9
  3. Save and exit. If your distro uses systemd-resolved, run sudo systemctl restart systemd-resolved.

Step 3: Fix the default gateway

If ping 8.8.8.8 also fails, your device has no route to the internet. This happens when DHCP fails or the router's IP changed. Do this:

  1. Open a terminal and check your default gateway:
    ip route | grep default

    On Windows: route print and look for 0.0.0.0 with a metric under Gateway.
  2. If the gateway is missing or wrong, renew your IP lease:
    • Windows: ipconfig /release then ipconfig /renew.
    • macOS: sudo ifconfig en0 down then sudo ifconfig en0 up (replace en0 with your interface name — run ifconfig to find it).
    • Linux: sudo dhclient -v or sudo dhcpcd, depending on your distro.
  3. After renewal, check again with ip route — you should see something like default via 192.168.1.1 dev wlan0.

Step 4: Kill the VPN remnants

VPNs often leave behind custom DNS entries or route changes. Even after disconnecting, some stay. Restart your network adapter — it's faster than rebooting:

  • Windows: Open Device Manager, expand Network adapters, right-click your Wi-Fi card, choose Disable, wait 5 seconds, then Enable.
  • macOS: Turn Wi-Fi off and on in the menu bar.
  • Linux: sudo nmcli networking off && sudo nmcli networking on (if using NetworkManager).

Still failing? Check these

  • Router captive portal: Some public Wi-Fi networks (airports, cafés) redirect all traffic to a login page. Open any browser — if you see a login page, you're not really connected. Try visiting http://example.com (not HTTPS) to trigger the portal.
  • IPv6 issues: Some ISPs have broken IPv6. Temporarily disable IPv6 on your adapter (Windows: uncheck IPv6 in adapter properties). If the internet works, your ISP's IPv6 is the problem. Keep it off.
  • Router overload: Too many devices on the same router can exhaust the DHCP pool. Reset the router by unplugging it for 30 seconds. This forces a fresh DHCP lease for everyone.
  • Antivirus or firewall: Some security software (looking at you, Norton) injects their own DNS proxy. Temporarily disable the firewall component to test.

If none of this works, you're dealing with a hardware problem — likely a dying router or a loose Ethernet cable (yes, even on Wi-Fi, the router's WAN port matters). Replace the router or call your ISP to check the line.

Related Errors in Network & Connectivity
Network Packet Reordering Detected: 3 Fixes That Work 0X00000315 Fix ERROR_LOST_WRITEBEHIND_DATA_NETWORK_SERVER_ERROR (0x315) 0X000025ED Fix DNS CNAME collision error 0X000025ED quickly 0X8004D10A Fix XACT_E_LU_NOT_CONNECTED (0x8004D10A) on DTC transactions

Was this solution helpful?

EP
Erropedia Team
Tech Support Editors
The Erropedia editorial team researches and documents real-world tech errors from across Windows, Linux, macOS, networking, databases, cloud platforms, and more. Every solution is reviewed for accuracy and updated as software and systems evolve.