Skip to content

Set Hosts File Entry

Adds or removes a single entry in the Windows hosts file, so a hostname can be pointed at a specific IP address on the endpoint.\n\nAdding an entry that is already present changes nothing, and removing an entry leaves every other line in the file untouched.\n\nIf the hostname already points at another IP address, that entry is replaced so the hostname resolves to the IP address specified here.

Required — Default: Add

Select whether the entry should be added to the hosts file or removed from it. Allowed values: Add, Remove.

Required

The IP address the hostname should resolve to. Both IPv4 and IPv6 addresses are accepted.\n\nExample:\n192.168.1.50\n::1

Required

The name that should resolve to the IP address. Use the name exactly as it is typed in a browser or a command line, without a protocol and without a path.\n\nExample:\nintranet.contoso.com

Optional

An optional note that is written at the end of the entry, so it is visible in the hosts file who added the line and why. Leave it empty to write the entry without a note.\n\nExample:\nAdded by IT for the intranet migration

Required — Default: True

Enable to save a timestamped copy of the hosts file before it is changed, so the previous content can be restored if needed. The copy is placed in the PowerBricks log folder. Disable to change the hosts file without saving a copy. No copy is saved when nothing has to be changed.

  • Category: System
  • Brick ID: Hosts-Entry-Set