Documentation
¶
Index ¶
- type PeerActivator
- type PeerConnectivity
- type Resolver
- func (d *Resolver) ID() types.HandlerID
- func (d *Resolver) MatchSubdomains() bool
- func (d *Resolver) RegisterRecord(record nbdns.SimpleRecord) error
- func (d *Resolver) ServeDNS(w dns.ResponseWriter, r *dns.Msg)
- func (d *Resolver) SetPeerActivator(a PeerActivator)
- func (d *Resolver) SetPeerConnectivity(p PeerConnectivity)
- func (d *Resolver) Stop()
- func (d *Resolver) String() string
- func (d *Resolver) Update(customZones []nbdns.CustomZone)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PeerActivator ¶ added in v0.75.0
type PeerActivator interface {
// ActivatePeersByIP triggers wake-up for the peer(s) owning addrs and blocks
// until one is connected or ctx (a short per-query budget) expires. It is a
// fast no-op for unknown or already-connected addresses.
ActivatePeersByIP(ctx context.Context, addrs []netip.Addr)
}
PeerActivator wakes lazy-connection peers on demand. The local resolver calls it with the tunnel IPs an answer points at, so a peer that is idle (lazily disconnected) starts connecting at DNS-resolution time rather than racing the client's first request packet. nil disables warm-up.
type PeerConnectivity ¶ added in v0.72.0
PeerConnectivity reports whether a tunnel IP belongs to a peer the client knows about and whether that peer is currently connected. The local resolver uses this to suppress A/AAAA answers whose RDATA points at a disconnected peer (typical case: a synthesized private-service record pointing at an embedded proxy peer that just went offline).
known=false means the IP isn't in the local peerstore at all — the record is left alone (it points at something outside our mesh, e.g. a non-peer upstream).
type Resolver ¶
type Resolver struct {
// contains filtered or unexported fields
}
func NewResolver ¶
func NewResolver() *Resolver
func (*Resolver) MatchSubdomains ¶
func (*Resolver) RegisterRecord ¶
func (d *Resolver) RegisterRecord(record nbdns.SimpleRecord) error
RegisterRecord stores a new record by appending it to any existing list
func (*Resolver) ServeDNS ¶
func (d *Resolver) ServeDNS(w dns.ResponseWriter, r *dns.Msg)
ServeDNS handles a DNS request
func (*Resolver) SetPeerActivator ¶ added in v0.75.0
func (d *Resolver) SetPeerActivator(a PeerActivator)
SetPeerActivator wires the DNS-time lazy-connection warm-up. Pass nil to disable. Safe to call multiple times; the latest value wins.
func (*Resolver) SetPeerConnectivity ¶ added in v0.72.0
func (d *Resolver) SetPeerConnectivity(p PeerConnectivity)
SetPeerConnectivity wires the per-IP connectivity check used to filter out A/AAAA answers pointing at disconnected peers. Pass nil to disable. Safe to call multiple times; the latest value wins.
func (*Resolver) Update ¶
func (d *Resolver) Update(customZones []nbdns.CustomZone)
Update replaces all zones and their records