# Hosts编辑

{% hint style="info" %}

* 本功能使用Clash核心内置的功能实现Hosts，具体请参看 [**Clash Wiki**](https://lancellc.gitbook.io/clash/clash-config-file/dns/host)；
* <mark style="color:orange;">修改Hosts有风险</mark>，不懂勿动；
* 本功能提交修改后，<mark style="color:orange;">重启MC插件生效</mark>。
  {% endhint %}

![](https://2210545339-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLM5FFd4bg7Kj4MoWUXus%2Fuploads%2FVjminhVUEzVeXpclsAO9%2F37.jpg?alt=media\&token=da21318f-ae2d-40d3-a1ff-41658c46704b)

* <mark style="color:blue;">**配置示例**</mark>

格式：(空两格)<mark style="color:orange;">'域名':</mark>(空格)<mark style="color:orange;">IP</mark>

```yaml
hosts:
  '*.clash.dev': 127.0.0.1 
  '*.foo.*.example.com': 123.123.123.123
  'alpha.clash.dev': ::1
```

{% hint style="info" %}
**静态**域名<mark style="color:orange;">优先级高于</mark>**通配符**域名
{% endhint %}

* <mark style="color:blue;">**MC初始化Hosts文件**</mark>（<mark style="color:orange;">勿删</mark>）

```yaml
hosts:
#开启MC后，可使用域名登陆路由器后台
  router.asus.com: 192.168.50.1
  #google中国重新定向
  services.googleapis.cn: 74.125.193.94
  #win网络状态检查
  ipv6.msftconnecttest.com: 2a01:111:2003::52
  www.msftconnecttest.com: 13.107.4.52

```

{% hint style="warning" %}
若未找到本页介绍的功能模块，请先到【<mark style="color:blue;">附加功能</mark>】里打开该模块显示，请参看 [**FAQ13**](https://mcreadme.gitbook.io/mc/mcold/faq/faq1#q13) **。**
{% endhint %}
