Getting Started

How to Point Chrome & Edge to a Specific IP for a Website

You can configure Google Chrome and Microsoft Edge to resolve a specific website to a custom IP address using the --host-resolver-rules flag. This is useful for testing or development, such as:

  • Testing a new website deployment: Access the new version in Chrome and the live version in Firefox.
  • Side-by-side comparison: Open different versions of the same website and easily copy and paste between them.

Note: This technique uses an advanced, unsupported feature. Our web design team uses this hack every day, and we encourage you to give it a try. However, it is not covered by Ecenica Support, and please use it at your own risk.


Steps for Google Chrome on Mac

  1. Quit Chrome
    Close all running instances of Google Chrome.

  2. Open Terminal
    Open Terminal by pressing Cmd + Space, typing Terminal, and pressing Enter.

  3. Run Chrome, or Edge with Custom Host Resolver Rules

    Enter the following command:

    open -a "Google Chrome" --args --host-resolver-rules="MAP example.com 100.100.100.100"

    Or for Edge:

    open -a "Microsoft Edge" --args --host-resolver-rules="MAP ecenica.com 100.100.100.100"

    Be sure to replace 100.100.100.100 with the IP address of your Ecenica server.

  4. Test the Configuration
    Visit example.com in Chrome. It will now resolve to the specified IP address.

  5. Restore Default Settings
    Quit Chrome and reopen it normally to reset DNS resolution.


Steps for Windows

  1. Quit Chrome
    Close all running instances of Google Chrome.

  2. Locate Chrome’s Shortcut

    • Right-click the Google Chrome shortcut on your desktop or Start menu.
    • Select Properties.
  3. Edit the Target Field
    In the Target field, append the following:

    –host-resolver-rules=’MAP example.com 100.100.100.100′

    Example:

    ‘C:\Program Files\Google\Chrome\Application\chrome.exe’ –host-resolver-rules=’MAP example.com 100.100.100.100′

  4. Save and Launch Chrome
    Click OK to save. Use this shortcut to launch Chrome and resolve example.com to the specified IP.

  5. Restore Default Settings
    Close all Chrome windows and reopen Chrome normally.


Limitations and Notes

  • Not Always Reliable: Support for --host-resolver-rules varies across Chrome versions and operating systems. It may not always work as intended, particularly with IPv6.
  • Temporary Effect: This only affects Chrome during the current session.
  • Advanced Users Only: Requires command-line or shortcut modifications.

For long-term changes, consider using your system’s hosts file or a local DNS server. Since this feature is experimental, it is not covered by Ecenica Support.


Browser Compatibility

Google Chrome

  • Supports --host-resolver-rules: Yes
  • Usage: Allows mapping specific domains to custom IP addresses on a per-session basis.

Firefox

  • Supports --host-resolver-rules: No
  • Alternative: Use extensions like SwitchHosts or configure a proxy server to map DNS.

Safari

  • Supports --host-resolver-rules: No
  • Alternative: Use system-wide changes (e.g., modify /etc/hosts) or configure a custom proxy.

Microsoft Edge

  • Supports --host-resolver-rules: Yes
  • Usage: Same feature as Chrome due to Edge’s Chromium base.

Was this guide helpful?

Need help with this?

Open a ticket and link to this guide so our team can see what you have tried.

View support tickets

Power your business with Ecenica Hosting

Built for WordPress and serious websites. Fast, secure and supported by real people in the UK.

Ecenica hosting services represented by a connected red route across London