Getting Started

Deployment Deployment - Diagnose Migrations Staging

Site Management

Backups Client Reporting Passwords Plugin Automation Plugin Management - Global Plugins & Themes - Diagnose Plugins & Themes - General Plugins & Themes - Git Plugins & Themes - Logs Must Install White Label WordPress Updates

Caching & Performance

Caching Caching - Blogs/Articles Caching - Diagnose Caching - Git Caching - WooCommerce Redis Optimize & Scale

Security

Security Security - Firewall

SMTP, CDN & DNS

SMTP SendGrid CDN CDN - AWS CDN - Cloudflare CDN - Diagnose Domains & DNS

Server & Tools

Analytics & Logs CRON Jobs Database Debug Tool Git Monitoring PHP Settings Redirects SEO Tools Server Errors sFTP SSL

Staq Billing

Staq Billing > Account Staq Billing > Client Staq Billing > Setup

Media

Media Media - Diagnose Media - Optimize

Accounts & Billing

Accounts & Billing

General

WordPress Hosting Website Diagnose Troubleshoot - Other

Resolving Localized Issues Caused by Hardcoded IP Addresses in the Hosts File


On this page

    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

    1. 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
    1. Open the Command Prompt application.
    2. Type ping example.com, replacing example.com with the root domain.
    3. Check the IP address returned by the ping command. Does it match the IP noted in the Staq Panel?
    For Mac
    1. Open the Terminal application.
    2. Type ping example.com, replacing example.com with the root domain.
    3. Check the IP address returned by the ping command. 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:

    Historical DNS Lookup

    Click Historical Data:Historical DNS Data

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

    Historical DNS Results

    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

    1. Open Notepad as an administrator by searching for Notepad, right-clicking, and selecting Run as Administrator.
    2. Navigate to C:\Windows\System32\drivers\etc.
    3. Open the hosts file.
    4. Look for entries related to the domain (e.g., example.com).
    5. Delete or comment out the line by adding # at the start of the line.
    6. Save the file and close Notepad.

    For Mac

    1. Open the Terminal application.
    2. Type sudo nano /etc/hosts and press Enter.
    3. Enter your password when prompted.
    4. Look for entries related to the domain (e.g., example.com).
    5. Delete or comment out the line by adding # at the start of the line.
    6. Press Control + O to save the file and Control + X to exit.

    Flush the DNS Cache

    After editing the hosts file, flush the DNS cache to ensure the changes take effect:

    For Windows
    1. Open Command Prompt as an administrator.
    2. Type ipconfig /flushdns and press Enter.
    3. You should see a confirmation message that the DNS cache has been cleared.
    For Mac
    1. Open the Terminal application.
    2. Type sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder and press Enter.
    3. 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.