You open Chrome to test your new web app, but instead of your page, you see: ERR_NAME_NOT_RESOLVED. This error means Chrome couldn't translate the domain name into an IP address. DNS (Domain Name System) is the phonebook of the internet — when it fails, your browser cannot connect to the server. For a developer, this often happens after changing DNS settings, switching networks, or misconfiguring local development environments. You can fix it without any special tools. Here's how, step by step, with the reasoning behind each one.

What Causes ERR_NAME_NOT_RESOLVED?
The error appears when Chrome sends a DNS query and receives no valid response. Here's what usually causes it:
- Corrupted DNS cache on your operating system.
- Your ISP’s DNS server is temporarily down or slow.
- Misconfigured network adapter settings (e.g., static DNS pointing to a dead server).
- A proxy or VPN interfering with DNS traffic.
- Your computer’s
hostsfile contains an incorrect mapping for the domain. - Router firmware issues or DNS forwarding problems.
Step 1: Flush the DNS Cache
The quickest fix is clearing the local DNS resolver cache. This forces your system to fetch fresh DNS records from the server.
On Windows:
- Open Command Prompt as Administrator (search
cmd, right-click, select Run as administrator). - Type
ipconfig /flushdnsand press Enter. - You should see: Successfully flushed the DNS Resolver Cache.
On macOS:
- Open Terminal.
- Run
sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder(you may need to enter your password). - No output means success.
On Linux (systemd-resolved):
- Open Terminal.
- Run
sudo systemd-resolve --flush-caches. Alternatively,sudo resolvectl flush-cacheson newer distributions.
After flushing, restart Chrome and try the URL again.
Step 2: Change Your DNS Server
ISP-provided DNS servers are sometimes unreliable or slow. Switching to a public, privacy-focused resolver often resolves the error immediately. Two widely trusted options:
- Cloudflare (1.1.1.1 and 1.0.0.1) — emphasizes speed and privacy; does not log your queries.
- Google Public DNS (8.8.8.8 and 8.8.4.4) — reliable but logs anonymized data.
How to change DNS in Windows:
- Go to Control Panel > Network and Sharing Center > Change adapter settings.
- Right-click your active network connection (Wi-Fi or Ethernet) and select Properties.
- Select Internet Protocol Version 4 (TCP/IPv4) and click Properties.
- Choose Use the following DNS server addresses and enter
1.1.1.1and1.0.0.1. - Click OK, then close all dialogs.
On macOS:
- Open System Preferences > Network.
- Select your active connection and click Advanced.
- Go to the DNS tab, remove existing entries, and add
1.1.1.1and1.0.0.1. - Click OK and then Apply.
On Linux (NetworkManager):
- Edit the connection profile:
nmcli con mod "YourConnectionName" ipv4.dns "1.1.1.1 1.0.0.1". - Restart NetworkManager:
sudo systemctl restart NetworkManager.

Step 3: Check the Hosts File
The hosts file is a local override for DNS. A stray entry can block or misdirect a domain. This is especially common if you’ve been working with local development environments like localhost or virtual hosts.
Locations:
- Windows:
C:WindowsSystem32driversetchosts - macOS / Linux:
/etc/hosts
Open the file with a plain text editor (administrator/root privileges required). Look for any line that maps the failing domain to an IP address (e.g., 127.0.0.1 example.com). If you didn’t intentionally add it, comment it out by placing a # at the beginning of the line. Save the file and flush DNS again.
Step 4: Disable Proxy and VPN Temporarily
Proxy servers or VPNs can intercept DNS queries and return incorrect results. For testing, disable them:
- Windows: Settings > Network & Internet > Proxy — turn off Use a proxy server.
- macOS: System Preferences > Network > Advanced > Proxies — uncheck all protocols.
- Linux: Check environment variables
http_proxyandhttps_proxywithecho $http_proxy. Unset them withunset http_proxy https_proxy.
If the error disappears after disabling the proxy, reconfigure your proxy settings to use automatic DNS or switch to a direct connection for that domain.
Step 5: Reset Network Stack
If the above steps fail, resetting the network stack can clear deeper misconfigurations. This is safe and does not affect your personal files.
Windows:
- Open Command Prompt as Administrator.
- Run these commands one by one:
netsh int ip reset netsh winsock reset ipconfig /release ipconfig /renew - Restart your computer.
macOS and Linux:
On macOS, you can delete network configuration files in /Library/Preferences/SystemConfiguration/ (backup first), then reboot. On Linux, restart the network service: sudo systemctl restart networking or use nmcli networking off && nmcli networking on.
Step 6: Test DNS Resolution Manually
Before blaming Chrome, verify that the domain resolves at the system level. Use nslookup or dig from the terminal:
nslookup example.com
If you get a Non-existent domain or timeout, the problem is upstream. If it resolves correctly, the issue is likely Chrome-specific — try clearing Chrome’s internal DNS cache by visiting chrome://net-internals/#dns and clicking Clear host cache.
Preventing Future DNS Errors
Developers can adopt a few habits to minimize DNS-related interruptions:
- Use a reliable public DNS server as a fallback in your router settings so all devices benefit.
- When working with local domains, keep your
hostsfile tidy and document any changes. - If you frequently switch networks (home, office, coffee shop), consider using a local DNS resolver like
dnsmasqfor consistency. - Monitor your network with tools like
pingandtracerouteto isolate whether the failure is local or remote.
After applying the fix, run nslookup example.com in your terminal to verify that the domain now resolves to the expected IP address. If it does, reopen Chrome and the page should load normally. If the error persists, the problem may lie with the remote server itself — check its status via a service like downforeveryoneorjustme.com (manually, without clicking any link).
