Documentation
¶
Overview ¶
Package tsdns provides DNS resolution through the Tailscale local API.
This works around tailscale/tailscale#5840 where tsnet.Server.Dial falls back to the system resolver for non-tailnet names, breaking split DNS resolution.
Index ¶
- func LookupHost(ctx context.Context, query QueryFunc, host string) ([]string, error)
- func NewDialer(tsDial func(ctx context.Context, network, addr string) (net.Conn, error), ...) func(ctx context.Context, network, addr string) (net.Conn, error)
- func NewLookupFunc(query QueryFunc) func(ctx context.Context, host string) ([]string, error)
- type QueryFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LookupHost ¶
LookupHost resolves a hostname to IP addresses using the provided Tailscale DNS query function. The query function should call local.Client.QueryDNS (or equivalent) which goes through the full Tailscale DNS stack including MagicDNS and split DNS.
func NewDialer ¶
func NewDialer(tsDial func(ctx context.Context, network, addr string) (net.Conn, error), query QueryFunc) func(ctx context.Context, network, addr string) (net.Conn, error)
NewDialer creates a dialer that resolves hostnames through Tailscale's DNS stack before dialing via the provided Tailscale dialer. This ensures split DNS domains are resolved correctly.