Update documentations

This commit is contained in:
世界
2022-07-23 09:29:37 +08:00
parent 884c0cf595
commit 187de6c738
10 changed files with 109 additions and 59 deletions

View File

@@ -0,0 +1,67 @@
# DNS Hijack
#### Sniff Mode
```json
{
"inbounds": [
{
"type": "tun",
"inet4_address": "172.19.0.1/30",
"auto_route": true,
"sniff": true // required
}
],
"outbounds": [
{
"type": "direct"
},
{
"type": "dns",
"tag": "dns-out"
}
],
"route": {
"rules": [
{
"protocol": "dns",
"outbound": "dns-out"
}
],
"auto_detect_interface": true
}
}
```
#### Port Mode
```json
{
"inbounds": [
{
"type": "tun",
"inet4_address": "172.19.0.1/30",
"auto_route": true,
"sniff": true // not required
}
],
"outbounds": [
{
"type": "direct"
},
{
"type": "dns",
"tag": "dns-out"
}
],
"route": {
"rules": [
{
"port": 53,
"outbound": "dns-out"
}
],
"auto_detect_interface": true
}
}
```

View File

@@ -4,4 +4,5 @@ Configuration examples for sing-box.
* [Shadowsocks Server](./ss-server)
* [Shadowsocks Client](./ss-client)
* [Shadowsocks Tun](./ss-tun)
* [Shadowsocks Tun](./ss-tun)
* [DNS Hijack](./dns-hijack.md)

View File

@@ -26,7 +26,6 @@
"type": "tun",
"inet4_address": "172.19.0.1/30",
"auto_route": true,
"hijack_dns": true,
"sniff": true
}
],
@@ -46,10 +45,18 @@
{
"type": "block",
"tag": "block"
},
{
"type": "dns",
"tag": "dns-out"
}
],
"route": {
"rules": [
{
"protocol": "dns",
"outbound": "dns-out"
},
{
"geosite": "category-ads-all",
"outbound": "block"