mirror of
https://github.com/SagerNet/sing-box.git
synced 2024-11-25 10:01:30 +00:00
Update documentations
This commit is contained in:
parent
884c0cf595
commit
187de6c738
|
@ -1,44 +0,0 @@
|
|||
`dns` inbound is a DNS server.
|
||||
|
||||
### Structure
|
||||
|
||||
```json
|
||||
{
|
||||
"inbounds": [
|
||||
{
|
||||
"type": "dns",
|
||||
"tag": "dns-in",
|
||||
|
||||
"listen": "::",
|
||||
"listen_port": 5353,
|
||||
"network": "udp"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
!!! note ""
|
||||
|
||||
There are no outbound connections by the DNS inbound, all requests are handled internally.
|
||||
|
||||
### Listen Fields
|
||||
|
||||
#### listen
|
||||
|
||||
==Required==
|
||||
|
||||
Listen address.
|
||||
|
||||
#### listen_port
|
||||
|
||||
==Required==
|
||||
|
||||
Listen port.
|
||||
|
||||
### DNS Fields
|
||||
|
||||
#### network
|
||||
|
||||
Listen network, one of `tcp` `udp`.
|
||||
|
||||
Both if empty.
|
|
@ -23,7 +23,6 @@
|
|||
| `tun` | [Tun](./tun) |
|
||||
| `redirect` | [Redirect](./redirect) |
|
||||
| `tproxy` | [TProxy](./tproxy) |
|
||||
| `dns` | [DNS](./dns) |
|
||||
|
||||
#### tag
|
||||
|
||||
|
|
|
@ -15,7 +15,6 @@
|
|||
"inet6_address": "fdfe:dcba:9876::1/128",
|
||||
"mtu": 1500,
|
||||
"auto_route": true,
|
||||
"hijack_dns": true,
|
||||
|
||||
"sniff": true,
|
||||
"sniff_override_destination": false,
|
||||
|
@ -49,10 +48,6 @@ Set the default route to the Tun.
|
|||
|
||||
To avoid traffic loopback, set `route.auto_detect_interface` or `route.default_interface` or `outbound.bind_interface`
|
||||
|
||||
#### hijack_dns
|
||||
|
||||
Hijack TCP/UDP DNS requests to the built-in DNS adapter.
|
||||
|
||||
### Listen Fields
|
||||
|
||||
#### sniff
|
||||
|
|
22
docs/configuration/outbound/dns.md
Normal file
22
docs/configuration/outbound/dns.md
Normal file
|
@ -0,0 +1,22 @@
|
|||
`dns` outbound is a DNS server.
|
||||
|
||||
### Structure
|
||||
|
||||
```json
|
||||
{
|
||||
"outbounds": [
|
||||
{
|
||||
"type": "dns",
|
||||
"tag": "dns-out"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
!!! note ""
|
||||
|
||||
There are no outbound connections by the DNS outbound, all requests are handled internally.
|
||||
|
||||
### Fields
|
||||
|
||||
No fields.
|
|
@ -20,6 +20,7 @@
|
|||
| `socks` | [Socks](./socks) |
|
||||
| `http` | [HTTP](./http) |
|
||||
| `shadowsocks` | [Shadowsocks](./shadowsocks) |
|
||||
| `dns` | [DNS](./dns) |
|
||||
| `selector` | [Selector](./selector) |
|
||||
| `urltest` | [URLTest](./urltest) |
|
||||
|
||||
|
|
|
@ -2,9 +2,10 @@ If enabled in the inbound, the protocol and domain name (if present) of by the c
|
|||
|
||||
#### Supported Protocols
|
||||
|
||||
| Network | Protocol | Domain Name |
|
||||
|:---------:|:----------:|:-------------:|
|
||||
| TCP | HTTP | Host |
|
||||
| TCP | TLS | Server Name |
|
||||
| UDP | QUIC | Server Name |
|
||||
| UDP | STUN | / |
|
||||
| Network | Protocol | Domain Name |
|
||||
|:-------:|:--------:|:-----------:|
|
||||
| TCP | HTTP | Host |
|
||||
| TCP | TLS | Server Name |
|
||||
| UDP | QUIC | Server Name |
|
||||
| UDP | STUN | / |
|
||||
| TCP/UDP | DNS | / |
|
67
docs/examples/dns-hijack.md
Normal file
67
docs/examples/dns-hijack.md
Normal 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
|
||||
}
|
||||
}
|
||||
```
|
|
@ -5,3 +5,4 @@ Configuration examples for sing-box.
|
|||
* [Shadowsocks Server](./ss-server)
|
||||
* [Shadowsocks Client](./ss-client)
|
||||
* [Shadowsocks Tun](./ss-tun)
|
||||
* [DNS Hijack](./dns-hijack.md)
|
|
@ -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"
|
||||
|
|
|
@ -48,7 +48,6 @@ nav:
|
|||
- Tun: configuration/inbound/tun.md
|
||||
- Redirect: configuration/inbound/redirect.md
|
||||
- TProxy: configuration/inbound/tproxy.md
|
||||
- DNS: configuration/inbound/dns.md
|
||||
- Outbound:
|
||||
- configuration/outbound/index.md
|
||||
- Direct: configuration/outbound/direct.md
|
||||
|
@ -56,6 +55,7 @@ nav:
|
|||
- Socks: configuration/outbound/socks.md
|
||||
- HTTP: configuration/outbound/http.md
|
||||
- Shadowsocks: configuration/outbound/shadowsocks.md
|
||||
- DNS: configuration/outbound/dns.md
|
||||
- Selector: configuration/outbound/selector.md
|
||||
- URLTest: configuration/outbound/urltest.md
|
||||
- Route:
|
||||
|
@ -70,6 +70,7 @@ nav:
|
|||
- Shadowsocks Server: examples/ss-server.md
|
||||
- Shadowsocks Client: examples/ss-client.md
|
||||
- Shadowsocks Tun: examples/ss-tun.md
|
||||
- DNS Hijack: examples/dns-hijack.md
|
||||
- Benchmark: benchmark.md
|
||||
markdown_extensions:
|
||||
- pymdownx.inlinehilite
|
||||
|
|
Loading…
Reference in a new issue