dnsutil

package
v0.4.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 5, 2026 License: GPL-2.0 Imports: 19 Imported by: 0

Documentation

Overview

Copyright (C) 2026 by saba <contact me via issue>

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.

In addition, no derivative work may use the name or imply association with this application without prior consent.

Copyright (C) 2026 by saba <contact me via issue>

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.

In addition, no derivative work may use the name or imply association with this application without prior consent.

Copyright (C) 2026 by saba <contact me via issue>

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.

In addition, no derivative work may use the name or imply association with this application without prior consent.

Copyright (C) 2026 by saba <contact me via issue>

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.

In addition, no derivative work may use the name or imply association with this application without prior consent.

Copyright (C) 2026 by saba <contact me via issue>

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.

In addition, no derivative work may use the name or imply association with this application without prior consent.

Copyright (C) 2026 by saba <contact me via issue>

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.

In addition, no derivative work may use the name or imply association with this application without prior consent.

Copyright (C) 2026 by saba <contact me via issue>

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.

In addition, no derivative work may use the name or imply association with this application without prior consent.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LookupIPsWithCache

func LookupIPsWithCache(ctx context.Context, host string) ([]net.IP, error)

func NewOutboundHTTPClient

func NewOutboundHTTPClient(timeout time.Duration, resolver *Resolver) *http.Client

func NewOutboundHTTPTransport

func NewOutboundHTTPTransport(timeout time.Duration, resolver *Resolver) *http.Transport

func OutboundDialer

func OutboundDialer(timeout time.Duration) *net.Dialer

OutboundDialer returns a net.Dialer that applies best-effort platform-specific outbound bypass options when the host process provides them via environment variables.

func ResolveWithCache

func ResolveWithCache(ctx context.Context, addr string) (string, error)

Types

type Options

type Options struct {
	DisableCache       bool            `json:"disable_cache"`
	DisableExpire      bool            `json:"disable_expire"`
	CacheTTLSeconds    int             `json:"cache_ttl_seconds"`
	TimeoutMs          int             `json:"timeout_ms"`
	DisableBogusFilter bool            `json:"disable_bogus_filter"`
	BogusNets          []string        `json:"bogus_nets"`
	Servers            []ServerOptions `json:"servers"`
}

func RecommendedClientOptions

func RecommendedClientOptions() Options

RecommendedClientOptions is the built-in target-DNS policy used by the mixed proxy client.

func (Options) Normalized

func (o Options) Normalized() Options

func (Options) Validate

func (o Options) Validate() error

type Resolver

type Resolver struct {
	// contains filtered or unexported fields
}

func Default

func Default() *Resolver

func NewResolver

func NewResolver(opts Options) (*Resolver, error)

func RecommendedClientResolver

func RecommendedClientResolver() *Resolver

RecommendedClientResolver returns the built-in IPv4-only resolver used for client-side public destination lookups such as PAC/geodata downloads.

func (*Resolver) LookupIPs

func (r *Resolver) LookupIPs(ctx context.Context, host string) ([]net.IP, error)

func (*Resolver) Resolve

func (r *Resolver) Resolve(ctx context.Context, addr string) (string, error)

type ServerOptions

type ServerOptions struct {
	Type      string            `json:"type"`
	Address   string            `json:"address"`
	Path      string            `json:"path"`
	Bootstrap []string          `json:"bootstrap"`
	Headers   map[string]string `json:"headers"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL