Restore the default hosts file to fix browsing
A webpage that will not load is often blamed on the site, the browser or the NBN connection. Before replacing routers or reinstalling software, check the hosts file: a small system text file that maps domain names to IP addresses before DNS resolution. An unwanted entry can redirect one address to 127.0.0.1, 0.0.0.0 or another server.
In Australia, this matters when a Geelong home has healthy NBN fibre but one site still fails, or a Melbourne commuter finds that mobile data from Telstra or Optus works. The bad mapping stays on the device, so changing network or ISP usually changes nothing. Knowing how to restore the default hosts file to fix browsing means removing the override while preserving normal localhost entries.
Why a changed hosts file stops pages loading
Domain names normally travel through DNS, which asks a resolver for the current IP address of a website. A hosts entry can jump ahead of that process. For example, a line sending blocked.example to 127.0.0.1 makes the browser try the computer itself, while 0.0.0.0 is commonly used to make a domain stop loading.
That local mapping may come from malware, a deliberate block, an ad-blocking utility or an old manual change. The signs include a DNS error for one domain, other sites opening normally, and a redirect to a local address. A link to this Geelong casino page might fail for the same reason as any other domain if a stray entry has captured it.
Hosts rules are not a firewall and do not block every site at once, so a partial failure can look inconsistent. They also remain relevant when a browser uses encrypted DNS, because the operating system checks the hosts file before the browser sends its DNS request. Restoring the file reverses that local instruction without changing your internet plan.
Check the cause before editing the file
Start by comparing devices and connections, rather than editing files at random. Open the affected page in a private window, switch from Wi-Fi to mobile data, and try another browser on the same computer. A private window can bypass a faulty extension, but it will not bypass a hosts entry.
Next, pause ad or privacy blockers one at a time and inspect the error wording. DNS_PROBE_FINISHED_NXDOMAIN points towards name resolution, while a connection to 127.0.0.1 suggests a local redirect. Secure DNS and VPN settings can also change the route, although none explains an entry already stored in the hosts file.
If every device on the home network fails at the same address, the hosts file is less likely to be responsible. Give the ISP-supplied NBN router a quick squiz: restart it, review its DNS settings and compare the result with another network. This separates a device problem from an ISP or website outage.
Restore the default file on Windows
On Windows 10 or 11, open File Explorer, paste C:\Windows\System32\drivers\etc into the address bar and open hosts with a text editor. The file has no ordinary extension, so “Open with” may be needed. Before changing it, copy it to the desktop as a backup.
If you cannot save directly, search for Notepad, right-click it and choose Run as administrator. Open the same file, then delete only custom domain mappings. Leave the Microsoft comments and localhost records intact. The clean default may include commented lines and entries for 127.0.0.1 localhost or ::1 localhost; those records support local services.
Do not delete every line and leave a blank file, and avoid downloading a mysterious “clean” copy. Windows can regenerate some networking components, but it will not reliably reconstruct the intended hosts settings for you. Save the edited file, confirm that it remains in the etc folder, then restart the browser.
Restore the default file on macOS and Linux
macOS and Linux keep the file at /etc/hosts. Open Terminal and run sudo nano /etc/hosts on macOS, or the same command on Linux if Nano is installed; sudo vi /etc/hosts is another option. Make a backup with sudo cp /etc/hosts /etc/hosts.backup before editing. Remove custom redirects, not the system records for localhost.
The defaults differ by operating system. A typical macOS file includes 127.0.0.1 localhost, 255.255.255.255 broadcasthost and ::1 localhost. Many Linux distributions include 127.0.0.1 localhost and an IPv6 localhost line, sometimes with hostname entries. Never paste the Windows example into a Mac or Linux machine, because the formats and services are not identical.
Use Ctrl+O, then Enter and Ctrl+X to save and close Nano. If permissions still block the save, check that the file is still named hosts and has not been saved as hosts.txt. This is particularly important for a Windows file edited on an external drive.
Run a simple before-and-after checking routine
Before editing the hosts file, use this short checklist:
- Open the failing address in two browsers.
- Try mobile data and a second device.
- Pause each ad blocker or privacy tool.
- Record the exact error message.
After saving the restored file, run this second sequence:
- Flush the operating system’s DNS cache.
- Close every browser window, then reopen it.
- Retest the affected domain and its links.
- Compare the result on another network.
For the DNS cache on Windows, run ipconfig /flushdns in Command Prompt. On macOS, use sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder. On Linux, sudo resolvectl flush-caches works on systems using systemd-resolved; distributions using another resolver need their own command. For a simple explanation of general loading failures, the cyberschooldps.net holding page offers a useful starting point. Then restart the browser or router and retest the address.
Reset your connections and get browsing working
The reset should leave ordinary DNS resolution with your chosen resolver, whether that comes from an Australian ISP, a public DNS service or a router configured for filtering. Confirm that familiar sites, local development addresses and required business tools still work. If a blocked address opens to the wrong page, check for a second hosts entry, an aggressive extension or stale DNS data.
Keep the backup until testing is complete, and avoid adding permanent shortcuts to the hosts file. When a domain needs to resolve locally during development, use the correct loopback address and remove the exception afterwards. Corporate or school-managed devices may have administrator policies, so ask the IT administrator before changing protected files.
That sequence isolates the cause without replacing working settings. Restore the default hosts file now, flush the DNS cache and test the affected address again.