View Categories

Can’t Connect to the Internet — Fix DNS and Network Configuration Errors

2 min read

Overview #

If your computer says “Connected, no internet” or pages won’t load even though Wi-Fi or Ethernet appears active, the problem is often software-level network configuration, not your router.
This guide helps you systematically diagnose DNS failures, misassigned IP addresses, and network stack corruption on both Windows and macOS — using built-in tools only.

What you’ll learn

  • How to verify network connectivity and adapter status
  • How to fix DNS and IP assignment issues
  • How to reset the network stack and renew connections
  • How to confirm your system can reach outside servers

Estimated time: 15–30 minutes
Skill level: Intermediate


Terms and Definitions #

TermMeaning
DNS (Domain Name System)Translates website names (like google.com) into IP addresses
IP ConfigurationThe local address, gateway, and subnet used by your device
DHCPProtocol that assigns IPs automatically on your network
Network StackSoftware layers that handle all networking (TCP/IP, DNS, Winsock)
Ping TestA diagnostic check to verify that data packets reach a destination

Steps #

Step 1 — Verify Network Connection and Adapter Status #

Windows PowerShell

Get-NetAdapter | Select Name, Status, LinkSpeed

If the adapter shows Status = Disconnected or Disabled, re-enable it:

Enable-NetAdapter -Name "Wi-Fi" -Confirm:$false

Then check your IP address:

ipconfig

If you see an address like 169.254.x.x, it means DHCP failed — your computer isn’t receiving an IP.

macOS Terminal

ifconfig en0

(Replace en0 with en1 if using Wi-Fi.)
If no valid IP appears, renew DHCP:

sudo ipconfig set en0 DHCP

Step 2 — Run a Basic Connectivity Test #

Windows

ping 8.8.8.8

If you get replies, your physical connection is working.
If that works but ping google.com fails, your issue is DNS-related.

macOS

ping -c 4 8.8.8.8
ping -c 4 google.com

If IP works but names don’t, DNS resolution is the culprit.


Step 3 — Clear and Reset DNS Cache #

Windows

ipconfig /flushdns

Then restart the DNS client service:

net stop dnscache
net start dnscache

macOS

sudo dscacheutil -flushcache
sudo killall -HUP mDNSResponder

This clears outdated DNS lookups.


Step 4 — Reset IP Configuration and Winsock (Windows Only) #

Sometimes your IP or TCP stack gets corrupted by VPNs or power loss.

netsh int ip reset
netsh winsock reset

Reboot afterward.

To release and renew your IP:

ipconfig /release
ipconfig /renew

Step 5 — Assign a Public DNS Manually #

If DNS lookups still fail, set your system to use Google or Cloudflare’s resolvers.

Windows PowerShell

Set-DnsClientServerAddress -InterfaceAlias "Wi-Fi" -ServerAddresses ("8.8.8.8","8.8.4.4")

macOS

sudo networksetup -setdnsservers Wi-Fi 8.8.8.8 1.1.1.1

To restore automatic DNS later:

sudo networksetup -setdnsservers Wi-Fi empty

Step 6 — Reset Network Stack or Location Profile #

Windows
To clear all stored network configurations:

netsh advfirewall reset
netsh interface ip delete arpcache

Then restart the Network Location Awareness service:

Restart-Service nlasvc

macOS
Reset the network location profile:

  1. Open System Settings → Network.
  2. Click the “…” → Duplicate Location, switch to the new one, and apply.
  3. Or use Terminal: sudo rm /Library/Preferences/SystemConfiguration/NetworkInterfaces.plist sudo rm /Library/Preferences/SystemConfiguration/preferences.plist sudo reboot

Step 7 — Check Router or Firewall Conflicts #

  • Restart your router and modem.
  • Temporarily disable any third-party firewall or VPN software.
  • If you use a corporate VPN, disconnect and test local browsing — VPNs often override DNS.

PowerShell firewall check

netsh advfirewall show allprofiles

Step 8 — Test External Connectivity Again #

Windows

Test-NetConnection google.com

If PingSucceeded = True and TcpTestSucceeded = True, internet access is restored.

macOS

curl -I https://www.apple.com

If you see an HTTP 200 or 301 response, connectivity is good.


Verification #

CheckCommandExpected Result
Adapter statusGet-NetAdapter / ifconfigConnected and enabled
IP addressipconfig / ifconfigValid local IP (not 169.254.x.x)
DNSping google.comResolves domain correctly
External connectionTest-NetConnection / curlSuccessful HTTP or ICMP response

Conclusion #

When your system says “Connected but no internet,” the culprit is almost always DNS failure, cached IP conflicts, or corrupted network stack settings.
By flushing DNS, resetting IP, and verifying adapter configuration, you can usually restore full connectivity within minutes.
If issues persist, test your router or modem with another device — if that fails too, contact your ISP to verify line-level service.

Powered by BetterDocs

Leave a Reply

Your email address will not be published. Required fields are marked *