Files
sing-box-extended-mirror/docs/configuration/dns/server/tailscale.md
T

126 lines
2.4 KiB
Markdown
Raw Normal View History

2025-04-06 19:14:41 +08:00
---
icon: material/new-box
---
2026-04-20 09:39:32 +08:00
!!! quote "Changes in sing-box 1.14.0"
:material-plus: [accept_search_domain](#accept_search_domain)
2025-04-06 19:14:41 +08:00
!!! question "Since sing-box 1.12.0"
# Tailscale
### Structure
```json
{
"dns": {
"servers": [
{
"type": "tailscale",
"tag": "",
"endpoint": "ts-ep",
2026-04-20 09:39:32 +08:00
"accept_default_resolvers": false,
"accept_search_domain": false
2025-04-06 19:14:41 +08:00
}
]
}
}
```
### Fields
#### endpoint
==Required==
2025-03-30 23:34:15 +08:00
The tag of the [Tailscale Endpoint](/configuration/endpoint/tailscale).
2025-04-06 19:14:41 +08:00
#### accept_default_resolvers
Indicates whether default DNS resolvers should be accepted for fallback queries in addition to MagicDNS。
2025-03-30 23:34:15 +08:00
if not enabled, `NXDOMAIN` will be returned for non-Tailscale domain queries.
2025-04-06 19:14:41 +08:00
2026-04-20 09:39:32 +08:00
#### accept_search_domain
!!! question "Since sing-box 1.14.0"
When enabled, single-label queries (e.g. `my-device`) are retried against each Tailscale search domain until one resolves.
Default resolvers are not consulted for single-label queries regardless of `accept_default_resolvers`.
2025-04-06 19:14:41 +08:00
### Examples
=== "MagicDNS only"
2026-04-10 11:34:39 +08:00
=== ":material-card-multiple: sing-box 1.14.0"
```json
{
"dns": {
"servers": [
{
"type": "local",
"tag": "local"
},
{
"type": "tailscale",
"tag": "ts",
"endpoint": "ts-ep"
}
],
"rules": [
{
"preferred_by": "ts",
"action": "route",
2026-04-10 11:34:39 +08:00
"server": "ts"
}
]
2025-04-06 19:14:41 +08:00
}
2026-04-10 11:34:39 +08:00
}
```
=== ":material-card-remove: sing-box < 1.14.0"
```json
{
"dns": {
"servers": [
{
"type": "local",
"tag": "local"
},
{
"type": "tailscale",
"tag": "ts",
"endpoint": "ts-ep"
}
],
"rules": [
{
"ip_accept_any": true,
"server": "ts"
}
]
2025-04-06 19:14:41 +08:00
}
2026-04-10 11:34:39 +08:00
}
```
2025-04-06 19:14:41 +08:00
=== "Use as global DNS"
```json
{
"dns": {
"servers": [
{
"type": "tailscale",
"endpoint": "ts-ep",
"accept_default_resolvers": true
}
]
}
}
2025-03-30 23:34:15 +08:00
```