/Hosts-Editor

Windows下编辑hosts文件的批处理程序 Batch program to edit hosts file on Windows

Primary LanguageBatchfileGNU General Public License v3.0GPL-3.0

zh-cn

hosts简介

Hosts文件是一个没有扩展名操作系统文件,以的形式存储了主机名IP地址映射关系[1]。Hosts又称host table,译为“主机表”。现代系统中,虽然DNS取代了主机表,但主机表的应用依旧很广[1]。和DNS不同的是,用户可以直接对Hosts文件进行控制。

用途

Hosts文件是大多数系统都存在的一个小型主机表。Hosts文件中包含了本地网络重要的主机名和地址信息,查询Hosts文件得到的结果比通过查询DNS得到的结果优先级更高。

Hosts文件也可以用于其它情况,例如可以将已知的广告服务器重定向到无广告的机器(通常是本地网络地址,如: 127.0.0.1)以过滤广告。使用Hosts文件还可以减少对DNS服务器的查询次数以加快访问网站的速度。

Hosts文件的另一个重要用途就是用于拦截一些恶意网站的请求,从而防止访问欺诈网站、感染病毒恶意软件

在面对网络审查的技术机制下,Hosts也被利用来处理因域名服务器缓存污染而对访问域名的地址解析进行修正,或者涉及域名与IP地址关系的技术调整等。

程序功能

  1. 查看现存hosts规则

  2. 添加hosts规则,规则重复则覆盖

  3. 删除现存hosts规则

说明

程序会自动获取管理员权限,如更改hosts文件失败请手动以管理员权限运行程序


en-us

Introduction to hosts

A hosts file is an operating systemfile with no extension that stores the mapping of host names and IP addresses in the form of a table[1]. In modern systems, host tables are still widely used, although DNS has replaced them [1]. Unlike DNS, users have direct control over the Hosts file.

Uses

The Hosts file is a small host table that exists on most systems.The Hosts file contains important host name and address information for the local network.The results obtained by querying the Hosts file have a higher priority than the results obtained by querying DNS.

The Hosts file can also be used in other situations, such as when known ad servers can be redirected to an ad-free machine (usually a local network address, e.g., 127.0.0.1) in order to filter [ads](https://zh. wikipedia.org/wiki/web-ads). Using a Hosts file also reduces the number of queries to the DNS servers to speed up access to the site.

Another important use of the Hosts file is for blocking some malicious Web site requests, thus preventing access to fraudulent Web sites, infection with viruses or malware.

In the face of web censorship technical mechanisms, Hosts are also utilized to deal with address resolution of accessed domain names due to domain name server cache pollution (), or technical adjustments involving the relationship between domain names and IP addresses.

Translated with DeepL.com (free version)

Program Functions

  1. view existing hosts rules

  2. Add hosts rules, duplicate rules will be overwritten.

  3. Delete existing hosts rules.

Description of the program

The program will automatically get administrator privileges, such as changing the hosts file fails, please manually run the program with administrator privileges.