Chrome Flags Reference

Chrome command line switches and startup flags for automation, headless mode, and debugging.

--host-rules

What does --host-rules do?

Deprecated alias for backwards compatibility, now does the same thing as --host-resolver-rules which should be used instead.

Usage

CLILaunch Chrome with --host-rules using CLI

chrome --host-rules

PuppeteerLaunch Chrome with --host-rules using Puppeteer

const browser = await puppeteer.launch({
  args: ['--host-rules']
});

PlaywrightLaunch Chrome with --host-rules using Playwright

const browser = await chromium.launch({
  args: ['--host-rules']
});

SeleniumLaunch Chrome with --host-rules using Selenium

from selenium import webdriver

options = webdriver.ChromeOptions()
options.add_argument('--host-rules')

driver = webdriver.Chrome(options=options)