콘텐츠로 이동
한국어

DnsSeedProvider

이 콘텐츠는 아직 번역되지 않았습니다.

Defined in: src/discovery/DnsSeedProvider.ts:27

Seed provider backed by DNS. Default mode resolves A records and pairs each IP with the configured port; SRV mode picks up name:port directly.

The actual DNS functions are injected via options so tests can stub them without touching the network. The real impl uses node:dns/promises.

TTL cache: repeated lookups inside the configured cacheTtlMs window are served from a per-instance in-memory cache, halving the DNS load on large clusters where each node polls the same name.

Address pinning (#145): whatever DNS says is, by construction, an answer from a party this node did not authenticate. With pinnedAddresses set, resolved addresses outside the list are dropped before they ever reach the cluster. This is defence in depth, not the primary control — mTLS is (a peer’s certificate must vouch for the address it claims, see cluster/PeerIdentity). It matters precisely where mTLS is not configured, and as a second layer where it is.

new DnsSeedProvider(options?): DnsSeedProvider

Defined in: src/discovery/DnsSeedProvider.ts:35

DnsSeedProviderOptions = {}

DnsSeedProvider

invalidateCacheForTest(): void

Defined in: src/discovery/DnsSeedProvider.ts:56

Test hook — drop the cached entry so the next lookup() re-queries DNS.

void


lookup(): Promise<NodeAddress[]>

Defined in: src/discovery/DnsSeedProvider.ts:43

Return candidate seed addresses.

Promise<NodeAddress[]>

SeedProvider.lookup