IAnswerable

Run Localhost with Custom Domain in Chrome

22 Jul 2025

🛠️ Goal

Run your local website on localhost but access it via a custom domain (e.g. example.ai) without editing /etc/hosts.

Here’s the request path once it’s set up:

flowchart LR
    A["Chrome browser"] --> B["ModHeader extension\nsets Host header"]
    B --> C["Request to 127.1.22.33"]
    C --> D["Local server sees\nHost: example.ai"]
  

🔧 Steps

1️⃣ Install ModHeader Chrome extension
👉 ModHeader on Chrome Web Store

2️⃣ Create a new profile in ModHeader

3️⃣ Set URL filter to match your localhost IP
Example:

*://127.1.22.33/*

4️⃣ Open http://127.1.22.33 in Chrome Chrome will send requests with Host: example.ai so your backend sees the expected domain.

✅ Benefits:


Quick summary: