Documentation ¶
Index ¶
- func GetExternalIPAddress(ctx context.Context) ([]net.IPAddr, error)
- func ReadFromSRV(service string, protocol string, name string, ...) (addrs []string, err error)
- func StartTelemetryURIUpdateService(interval time.Duration, cfg config.Local, genesisNetwork protocol.NetworkID, ...)
- type ResolveController
- type Resolver
- func (p *Resolver) EffectiveResolverDNS() string
- func (p *Resolver) LookupAddr(ctx context.Context, addr string) (names []string, err error)
- func (p *Resolver) LookupCNAME(ctx context.Context, host string) (cname string, err error)
- func (p *Resolver) LookupHost(ctx context.Context, host string) (addrs []string, err error)
- func (p *Resolver) LookupIPAddr(ctx context.Context, host string) ([]net.IPAddr, error)
- func (p *Resolver) LookupMX(ctx context.Context, name string) ([]*net.MX, error)
- func (p *Resolver) LookupNS(ctx context.Context, name string) ([]*net.NS, error)
- func (p *Resolver) LookupPort(ctx context.Context, network, service string) (port int, err error)
- func (p *Resolver) LookupSRV(ctx context.Context, service, proto, name string) (cname string, addrs []*net.SRV, err error)
- func (p *Resolver) LookupTXT(ctx context.Context, name string) ([]string, error)
- func (p *Resolver) SetFallbackResolverAddress(fallbackDNSResolverAddress net.IPAddr)
- type ResolverIf
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetExternalIPAddress ¶
GetExternalIPAddress retrieves the external IP address of the host.
func ReadFromSRV ¶
func ReadFromSRV(service string, protocol string, name string, fallbackDNSResolverAddress string, secure bool) (addrs []string, err error)
ReadFromSRV is a helper to collect SRV addresses for a given name.
func StartTelemetryURIUpdateService ¶
func StartTelemetryURIUpdateService(interval time.Duration, cfg config.Local, genesisNetwork protocol.NetworkID, log logging.Logger, abort chan struct{})
StartTelemetryURIUpdateService starts a go routine which queries SRV records for a telemetry URI every <interval>
Types ¶
type ResolveController ¶
type ResolveController struct {
// contains filtered or unexported fields
}
ResolveController provides a layer of abstaction for a regular, or DNSSEC-aware resolvers
func NewResolveController ¶
func NewResolveController(secure bool, fallbackDNSResolverAddress string, log logging.Logger) ResolveController
NewResolveController creates a new ResolveController
func (*ResolveController) DefaultResolver ¶
func (c *ResolveController) DefaultResolver() ResolverIf
DefaultResolver returns a resolver that uses fallback DNS address
func (*ResolveController) FallbackResolver ¶
func (c *ResolveController) FallbackResolver() ResolverIf
FallbackResolver returns a resolver that uses fallback DNS address
func (*ResolveController) SystemResolver ¶
func (c *ResolveController) SystemResolver() ResolverIf
SystemResolver returns a resolver that uses OS-defined DNS servers
type Resolver ¶
type Resolver struct {
// contains filtered or unexported fields
}
Resolver provides equivalent functionality to the net.Resolver with one exception - it allows to use a provided DNS server instead of relying on the existing default resolver.
func (*Resolver) EffectiveResolverDNS ¶
EffectiveResolverDNS returns effective DNS server address that would be used for the resolve operation.
func (*Resolver) LookupAddr ¶
LookupAddr performs a reverse lookup for the given address, returning a list of names mapping to that address.
func (*Resolver) LookupCNAME ¶
LookupCNAME returns the canonical name for the given host. Callers that do not care about the canonical name can call LookupHost or LookupIP directly; both take care of resolving the canonical name as part of the lookup. A canonical name is the final name after following zero or more CNAME records. LookupCNAME does not return an error if host does not contain DNS "CNAME" records, as long as host resolves to address records.
func (*Resolver) LookupHost ¶
LookupHost looks up the given host using the local resolver. It returns a slice of that host's addresses.
func (*Resolver) LookupIPAddr ¶
LookupIPAddr looks up host using the local resolver. It returns a slice of that host's IPv4 and IPv6 addresses.
func (*Resolver) LookupMX ¶
LookupMX returns the DNS MX records for the given domain name sorted by preference.
func (*Resolver) LookupPort ¶
LookupPort looks up the port for the given network and service.
func (*Resolver) LookupSRV ¶
func (p *Resolver) LookupSRV(ctx context.Context, service, proto, name string) (cname string, addrs []*net.SRV, err error)
LookupSRV tries to resolve an SRV query of the given service, protocol, and domain name. The proto is "tcp" or "udp". The returned records are sorted by priority and randomized by weight within a priority. LookupSRV constructs the DNS name to look up following RFC 2782. That is, it looks up _service._proto.name. To accommodate services publishing SRV records under non-standard names, if both service and proto are empty strings, LookupSRV looks up name directly.
func (*Resolver) SetFallbackResolverAddress ¶
SetFallbackResolverAddress sets preferred DNS server address
type ResolverIf ¶
type ResolverIf interface { dnssec.ResolverIf }
ResolverIf is re-import from dnssec.ResolverIf
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package dnssec provides net.Resolver-compatible methods for DNSSEC.
|
Package dnssec provides net.Resolver-compatible methods for DNSSEC. |