Documentation
¶
Index ¶
- Constants
- type AuthoritativeServer
- func (a *AuthoritativeServer) AnswerPacket(buffer []byte) []byte
- func (a *AuthoritativeServer) Host() string
- func (a *AuthoritativeServer) LoadSnapshot(snap ZoneSnapshot)
- func (a *AuthoritativeServer) RecordCount() int
- func (a *AuthoritativeServer) ServeTCP(bindAddr string) error
- func (a *AuthoritativeServer) ServeUDP(bindAddr string) error
- func (a *AuthoritativeServer) Shutdown()
- func (a *AuthoritativeServer) UpsertRecord(domain, recType, value string, ttl int)
- type DNSQueryPayload
- type DNSRecord
- type DNSResponsePayload
- type SecureDNS
- func (s *SecureDNS) AnswerWireQuery(packet []byte) ([]byte, error)
- func (s *SecureDNS) BuildSnapshot(host string) (ZoneSnapshot, error)
- func (s *SecureDNS) DeleteDomain(domain, recordType, value string) error
- func (s *SecureDNS) DeleteZoneType(domain, recordType string) error
- func (s *SecureDNS) ListRecords(domain string) ([]DNSRecord, error)
- func (s *SecureDNS) RegisterDomain(domain, recordType, value string, ttl int) error
- func (s *SecureDNS) RegisterGlueRecord(domain, recordType, value string, ttl int) error
- func (s *SecureDNS) ReplaceZoneType(domain, recordType, value string, ttl int) error
- func (s *SecureDNS) ResolveLocal(domain, recordType string) ([]DNSRecord, error)
- func (s *SecureDNS) ResolveMesh(ctx context.Context, domain, recordType string, timeout time.Duration) ([]DNSRecord, error)
- func (s *SecureDNS) ResolveWire(domain, recordType string) ([]DNSRecord, error)
- func (s *SecureDNS) ServeWireProtocol(bindAddr string) error
- func (s *SecureDNS) Shutdown()
- func (s *SecureDNS) SnapshotJSON(host string) ([]byte, error)
- type ZoneSnapshot
Constants ¶
const (
DNSPageID ultimate_db.PageID = 53
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthoritativeServer ¶ added in v1.0.3
type AuthoritativeServer struct {
// Recurse, if set, handles names not in the local zone (public internet).
// Private mesh names that miss stay NXDOMAIN and do not recurse.
Recurse func(query []byte, domain string) []byte
// IsPrivate reports whether domain is a mesh private-zone name.
IsPrivate func(domain string) bool
// contains filtered or unexported fields
}
AuthoritativeServer serves standard DNS wire queries from an in-memory zone table. Optional Recurse allows full-system DNS when clients point at this IP (e.g. Windows).
func NewAuthoritativeServer ¶ added in v1.0.3
func NewAuthoritativeServer(host string) *AuthoritativeServer
func (*AuthoritativeServer) AnswerPacket ¶ added in v1.0.3
func (a *AuthoritativeServer) AnswerPacket(buffer []byte) []byte
AnswerPacket builds a wire response from the in-memory zone (same path as UDP :53). Used by DoH so browser Secure DNS matches dig @ns.
func (*AuthoritativeServer) Host ¶ added in v1.0.3
func (a *AuthoritativeServer) Host() string
Host returns the configured authoritative host label (e.g. ns.0trust.cloud).
func (*AuthoritativeServer) LoadSnapshot ¶ added in v1.0.3
func (a *AuthoritativeServer) LoadSnapshot(snap ZoneSnapshot)
LoadSnapshot replaces the in-memory zone table.
func (*AuthoritativeServer) RecordCount ¶ added in v1.0.3
func (a *AuthoritativeServer) RecordCount() int
RecordCount returns the number of active records.
func (*AuthoritativeServer) ServeTCP ¶ added in v1.0.3
func (a *AuthoritativeServer) ServeTCP(bindAddr string) error
ServeTCP listens for DNS wire queries on the given TCP address (e.g. :53).
func (*AuthoritativeServer) ServeUDP ¶ added in v1.0.3
func (a *AuthoritativeServer) ServeUDP(bindAddr string) error
ServeUDP listens for DNS wire queries on the given UDP address (e.g. :53).
func (*AuthoritativeServer) Shutdown ¶ added in v1.0.3
func (a *AuthoritativeServer) Shutdown()
func (*AuthoritativeServer) UpsertRecord ¶ added in v1.0.3
func (a *AuthoritativeServer) UpsertRecord(domain, recType, value string, ttl int)
UpsertRecord inserts or replaces a single RR without wiping the zone. Used by edge failover cutover so ns.0trust.services can answer while cloud is down.
type DNSQueryPayload ¶
type DNSResponsePayload ¶
type SecureDNS ¶
type SecureDNS struct {
// contains filtered or unexported fields
}
func NewSecureDNS ¶
func NewSecureDNS(pr *secure_network.PeerRoute, sdf *secure_data_format.SecureDataEngine, localPub []byte, database *ultimate_db.DB) *SecureDNS
func (*SecureDNS) AnswerWireQuery ¶ added in v1.0.3
AnswerWireQuery resolves a standard DNS wire query from local storage (then mesh).
func (*SecureDNS) BuildSnapshot ¶ added in v1.0.3
func (s *SecureDNS) BuildSnapshot(host string) (ZoneSnapshot, error)
BuildSnapshot exports all non-expired DNS records from the local authoritative store.
func (*SecureDNS) DeleteDomain ¶ added in v1.0.3
func (*SecureDNS) DeleteZoneType ¶ added in v1.0.3
DeleteZoneType removes every record of a type under domain (used to refresh glue).
func (*SecureDNS) ListRecords ¶ added in v1.0.3
func (*SecureDNS) RegisterDomain ¶
func (*SecureDNS) RegisterGlueRecord ¶ added in v1.0.3
RegisterGlueRecord stores a platform bootstrap/glue RR that does not expire locally.
func (*SecureDNS) ReplaceZoneType ¶ added in v1.0.3
ReplaceZoneType removes all records of a type under domain and stores a single value. Uses non-expiring glue storage so product apex A records survive restarts cleanly.
func (*SecureDNS) ResolveLocal ¶
func (*SecureDNS) ResolveMesh ¶
func (*SecureDNS) ResolveWire ¶ added in v1.0.3
ResolveWire answers authoritative wire queries from local storage without mesh/SDF.
func (*SecureDNS) ServeWireProtocol ¶
type ZoneSnapshot ¶ added in v1.0.3
type ZoneSnapshot struct {
Version int64 `json:"version"`
Host string `json:"host"`
Records []DNSRecord `json:"records"`
UpdatedAt time.Time `json:"updated_at"`
// PrivateSuffixes lists active private TLD suffixes (e.g. ".mesh", ".factory").
// Open namespace: any non-ICANN TLD registered on the control plane appears here
// so edges and split resolvers stay in sync without a fixed allowlist.
PrivateSuffixes []string `json:"private_suffixes,omitempty"`
}
ZoneSnapshot is the authoritative zone bundle replicated cloud → edge NS.