Command line utility for editing Windows HOSTS file.

Usage :

  /a     : Add single entry.
  /r     : Remove single entry.
  /am    : Add multiple entries, reading from text file.
  /rm    : Remove multiple entries, reading from text file.
  /b     : Create backup of HOSTS file.
  /fdns  : Flush Windows DNS Cache.
  /rip   : Replace IPs in HOSTS file.
  /res   : Restore HOSTS file to Windows default, or to a previous backup.
  /attr  : Set attributes for HOSTS file, ReadOnly(/attr r), Archive(/attr a), Both(/attr ra).

Samples :

  hostsedit /a 0.0.0.0 www.example-domain.com
  hostsedit /r www.example-domain.com
  hostsedit /am "D:\HOSTS Entries\example.txt"
  hostsedit /rm "D:\HOSTS Entries\example.txt"
  hostsedit /b "D:\HOSTS.BKP"
  hostsedit /fdns
  hostsedit /rip 0.0.0.0 127.0.0.1
  hostsedit /res
  hostsedit /res "D:\HOSTS.BKP"
  hostsedit /attr r

*for editing multiple entries instead of using /a, /r multiple times, prefer using /am, /rm.