Skip to content

Commit

Permalink
update ad-block.
Browse files Browse the repository at this point in the history
  • Loading branch information
pymumu committed Jan 4, 2024
1 parent d5b6e53 commit cde1174
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
8 changes: 7 additions & 1 deletion docs/config/ad-block.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,13 @@ b.com

### hosts格式

如下面命令,可以将`/path/to/hosts/file`的文件(路径换成实际的文件),转换为smartdns支持的格式
如下面命令,可以使用`hosts-file`来指定hosts格式文件

```shell
hosts-file /etc/smartdns/anti-ad-smartdns.hosts
```

也可以通过如下命令将hosts文件转换为smartdns特有格式。

```shell
cat /path/to/hosts/file | grep -v "^#" | awk '{print "address /"$2"/#"}' > anti-ad-smartdns.conf
Expand Down
8 changes: 7 additions & 1 deletion en/docs/config/ad-block.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,13 @@ For non-SmartDNS data, simple shell commands can convert it.

### hosts Format

The following command converts the `/path/to/hosts/file` file (replace the path with your actual file) to the format supported by SmartDNS:
You can use the `hosts-file` option to specify a hosts format file, as shown in the following command:

```shell
hosts-file /etc/smartdns/anti-ad-smartdns.hosts
```

You can also convert the hosts file to the specific format used by SmartDNS using the following command.

```shell
cat /path/to/hosts/file | grep -v "^#" | awk '{print "address /"$2"/#"}' > anti-ad-smartdns.conf
Expand Down

0 comments on commit cde1174

Please sign in to comment.