Resolving Localized Issues Caused by Hardcoded IP Addresses in the Hosts File
Sometimes, users encounter issues such as:
- The 1-click login feature shows a 404 error.
- Contact form submissions are not received, but tests by developers work as expected.
- The website displays the old version on certain networks or computers but works fine elsewhere.
- ERR_HTTP2_PROTOCOL_ERROR
- The website appears non-functional with messages about server termination but works on mobile devices and other computers.
The most likely cause is a hardcoded IP address in the hosts file on the user’s local computer or the local network DNS has cached old results. This is a localized issue and does not affect other users or systems.
DNS Network Issue
ERR_HTTP2_PROTOCOL_ERROR
The ERR_HTTP2_PROTOCOL_ERROR can sometimes occur due to internal DNS caching issues, especially after migrating a site to Staq. This error may happen when internal networks, such as those in shared workspaces like WeWork or other coworking spaces, have cached the domain and server details pointing to the old hosting provider. If the original hosting provider has been decommissioned, this cached data can result in protocol errors. To confirm if this is the case, try accessing the site on a different network, such as a mobile connection with Wi-Fi disabled. If the site works on other networks, the issue is most likely related to internal DNS caching. Either contact the IT administrator of the premises or wait until it naturally flushes.
Hardcoded IP in Hosts File Issue
Scenario 1: No CDN or Staq Traditional CDN
This situation applies if:
- No CDN is applied to the site.
- Staq Traditional CDN is active (check by navigating to the site’s Staq Panel > CDN where a green tick indicates activation).
- Cloudflare is used, but the proxy feature is disabled.
Follow these steps to diagnose the issue:
Find the Current Server IP Address
- Go to the site’s Staq Panel > Domains and note the server IP address listed.
Verify IP Address Using Command Prompt or Terminal
For Windows
- Open the Command Prompt application.
- Type
ping example.com, replacingexample.comwith the root domain. - Check the IP address returned by the
pingcommand. Does it match the IP noted in the Staq Panel?
For Mac
- Open the Terminal application.
- Type
ping example.com, replacingexample.comwith the root domain. - Check the IP address returned by the
pingcommand. Does it match the IP noted in the Staq Panel?
If the IP address does not match, the hosts file on the local computer has been altered. This is a localized issue that can be resolved by editing the hosts file (instructions below).
Scenario 2: Staq Next-Gen CDN or Cloudflare with Proxy Enabled
Assuming that if you go to the site’s Staq Panel, followed by Domains, you see green tickets in the table:

If that’s the case, follow the steps below.
If Staq Next-Gen CDN or Cloudflare with proxy is enabled, the server IP address will not be visible via ping. Use a third-party tool to find the historical IP address for comparison.
Finding the Historical IP Address
Register for a free account at SecurityTrails.
Search for the domain:

Click Historical Data:
Under the A Record tab, look for previous IP addresses listed under “Last Seen.”

Note down the previous IP address.
Verify the Local IP Address
Ask the user to follow the steps under the Verify IP Address Using Command Prompt or Terminal section above. If the IP address matches the old one found in SecurityTrails, the hosts file has been hardcoded and needs to be updated.
Editing the Hosts File
Follow the steps below to locate and edit the hosts file on Windows or Mac:
For Windows
- Open Notepad as an administrator by searching for Notepad, right-clicking, and selecting Run as Administrator.
- Navigate to
C:\Windows\System32\drivers\etc. - Open the
hostsfile. - Look for entries related to the domain (e.g.,
example.com). - Delete or comment out the line by adding
#at the start of the line. - Save the file and close Notepad.
For Mac
- Open the Terminal application.
- Type
sudo nano /etc/hostsand press Enter. - Enter your password when prompted.
- Look for entries related to the domain (e.g.,
example.com). - Delete or comment out the line by adding
#at the start of the line. - Press
Control + Oto save the file andControl + Xto exit.
Flush the DNS Cache
After editing the hosts file, flush the DNS cache to ensure the changes take effect:
For Windows
- Open Command Prompt as an administrator.
- Type
ipconfig /flushdnsand press Enter. - You should see a confirmation message that the DNS cache has been cleared.
For Mac
- Open the Terminal application.
- Type
sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponderand press Enter. - There won’t be a confirmation message, but the DNS cache will be cleared.
Conclusion
If the issue persists after following these steps, double-check the DNS settings and ensure the server IP address matches the correct configuration.
Need some help?
We all do sometimes. Please reach out to our support team by dropping us a support ticket. We will respond fast.