
I would like to devote some time to the hosts file. About two years ago, when I once again climbed into the depths of the system directories to fix just one line in this file, I thought how cool it would be to work with hosts from the command line. Then the idea went to the diary, and for a long time remained intact. A couple of days ago, I implemented almost all the ideas that came to mind about this. I share the result with the habrasoobshchestvom. I would be glad if someone come in handy.
What happened?
And it turned out a small program hosts.exe, which can be briefly described as follows:
- Add, remove, and disable host operations
- Supports host mask operations
- Simple samples from hosts by attributes and mask
- Creating backup hosts and rollback last operation
- IDN support (you can create Russian domains)
- IPv6 address support
- Support for aliases (multiple domain names per line)
- Preserves the original layout and coding of the hosts file
- A large number of aliases for each team (as it is more convenient for someone)
Where can I download?
Project Page: Hosts CommanderProgram: hosts-v1.3.zip (10 KB, .NET 3.5)
Source code: hosts-v1.3-src.zip (12 KB, C #, VS2010)
How to use it?
If you first copy the program file to the system directory, the utility will always be ready to work in the console or by pressing Win + R.
hosts list [enabled|disabled] [visible|hidden] <mask>
β ,
β β
β : view, select
β : list enabled visible local*
β : list vk
hosts add <host> <aliases> <addr> # <comment>
β , <addr> 127.0.0.1, <comment>
β <aliases>
β #
β # β
β : new
β : hosts add myhost.dev
β : hosts add another.dev 192.168.1.1 # Remote host
hosts set <host|mask> <addr> # <comment>
β IP
β # β
β : update, change
β : hosts set myhost.dev # new comment
β : hosts set another.dev 192.168.1.1
hosts rem <host|mask>
β
β : del, remove, delete
β : hosts rem *.local
hosts enable <host|mask>
β
β : on
β : hosts enable localhost
hosts disable <host|mask>
β
β : off
β : hosts disable local?ost
hosts print
β hosts
β : raw, file
hosts format
β
hosts clean
β
hosts backup <name>
β hosts
β <name> , β backup
hosts restore <name>
β hosts
β <name> , β backup
hosts rollback
β hosts
hosts open
β hosts
hosts hide <host|mask>
β hosts.exe
β , ,
hosts show <host|mask>
β
, Β« Β», , . , - .
Windows XP. Windows , UAC.
.