🔧 Network Troubleshooting 10 मिनट पढ़ें

Can't Connect to the Internet: Complete Diagnostic Guide

A systematic, step-by-step diagnostic guide for when you have no internet access — covering physical checks, IP configuration, DNS, ISP issues, and packet capture.

Symptoms and Quick Checks

Before diving deep, confirm exactly what is broken. Internet problems fall into several categories:

  • No connectivity at all — browser shows "unable to connect," ping to 8.8.8.8 fails
  • DNS failure only — you can ping 8.8.8.8 but not google.com
  • Partial connectivity — some sites work, others do not
  • Intermittent drops — connection drops every few minutes and recovers

Run these quick checks first:

# Can you reach your gateway (router)?
ping -c 4 192.168.1.1

# Can you reach the internet by IP? (tests routing, bypasses DNS)
ping -c 4 8.8.8.8

# Can you resolve DNS?
nslookup google.com

# Full connectivity test
curl -Is https://google.com | head -1

If ping 192.168.1.1 fails, the problem is between you and your router. If ping 8.8.8.8 fails but the router responds, the problem is between your router and the ISP. If ping 8.8.8.8 works but DNS fails, see the DNS guide.

Check Physical Connections

The most embarrassing — and most common — cause of no internet is a disconnected cable or disabled interface.

For wired connections:

  1. Check the Ethernet cable at both ends — the connector should click firmly into place.
  2. Look at the port LED on your router and computer. Green or amber activity lights indicate a physical link.
  3. Try a different cable or a different port on the router.
  4. On the network card: ip link show eth0 — the state should be UP.
# Check interface state (Linux)
ip link show

# Bring up an interface if it shows DOWN
sudo ip link set eth0 up

# macOS equivalent
ifconfig en0

For wireless connections:

  1. Confirm Wi-Fi is enabled — not accidentally switched off via a keyboard shortcut.
  2. Check you are connected to your own network, not a neighbor's that has no uplink.
  3. Move closer to the router to rule out signal strength issues.

Verify IP Configuration

Once the physical layer is confirmed, check that your device has a valid IP address.

# Linux/macOS — show all interfaces
ip addr show          # Linux
ifconfig              # macOS

# Windows
ipconfig /all

A healthy configuration looks like:

Field Expected Value Problem if
IP address 192.168.x.x or 10.x.x.x 169.254.x.x = APIPA (DHCP failed)
Subnet mask 255.255.255.0 Empty = interface down
Default gateway Router IP (e.g., 192.168.1.1) Missing = no route to internet
DNS servers 8.8.8.8 or router IP Missing = DNS will fail

If you see a 169.254.x.x address, DHCP failed. Try:

# Linux: request a new DHCP lease
sudo dhclient -v eth0

# macOS
sudo ipconfig set en0 DHCP

# Windows
ipconfig /release
ipconfig /renew

Test DNS Resolution

With a valid IP, test DNS separately:

# Test with system DNS
nslookup google.com

# Test with a known-good public DNS (bypasses your ISP's resolver)
nslookup google.com 8.8.8.8
nslookup google.com 1.1.1.1

# Using dig for more detail
dig google.com
dig google.com @8.8.8.8

If nslookup google.com 8.8.8.8 works but nslookup google.com fails, your ISP's DNS resolver or your router's DNS relay is broken. Change your DNS server to 8.8.8.8 or 1.1.1.1 as a workaround.

Restart Network Stack

Sometimes the network stack accumulates stale state. A clean restart often resolves mysterious failures.

# Linux: restart NetworkManager
sudo systemctl restart NetworkManager

# macOS: renew DHCP and flush DNS
sudo ipconfig set en0 DHCP
sudo dscacheutil -flushcache
sudo killall -HUP mDNSResponder

# Windows: full network stack reset
netsh int ip reset
netsh winsock reset
ipconfig /flushdns
# Reboot after these commands

On a router, a power cycle (unplug for 30 seconds) clears NAT tables and forces a fresh DHCP lease from the ISP.

ISP-Level Issues

If your router shows a WAN IP but you still cannot reach the internet, the issue is upstream from your router.

# Traceroute to see where packets stop
traceroute 8.8.8.8        # Linux/macOS
tracert 8.8.8.8           # Windows

# Check your router's WAN IP
# Log into router admin panel (typically 192.168.1.1)
# Look for WAN/Internet status — should show a public IP

If traceroute stops at the first hop beyond your router (the ISP's first gateway), contact your ISP. Tell them:

  • Your account number and service address
  • The exact error: "WAN connection established but no routing beyond first ISP hop"
  • The time the problem started

ISP outages are tracked publicly at sites like downdetector.com. Check before calling.

Advanced: Packet Capture Analysis

When the problem is intermittent or difficult to reproduce, a packet capture reveals exactly what is happening on the wire.

# Capture all traffic on eth0 (Linux/macOS)
sudo tcpdump -i eth0 -w /tmp/capture.pcap

# Capture only DNS traffic
sudo tcpdump -i eth0 port 53 -w /tmp/dns.pcap

# Capture ICMP (ping) traffic to 8.8.8.8
sudo tcpdump -i eth0 icmp and host 8.8.8.8

# Windows: use netsh
netsh trace start capture=yes IPv4.Address=8.8.8.8
netsh trace stop
# Opens in Windows Event Viewer or analyzable in Wireshark

Open the .pcap file in Wireshark and look for:

  • DNS query with no response — resolver is not answering
  • TCP SYN with no SYN-ACK — remote server or firewall blocking
  • ICMP host unreachable — routing problem
  • TCP RST from server — connection actively rejected

A packet capture gives you irrefutable evidence to escalate to your ISP or identify a misconfiguration on your own equipment.