温馨提示:本站仅提供公开网络链接索引服务,不存储、不篡改任何第三方内容,所有内容版权归原作者所有
AI智能索引来源:http://www.bun.com/reference/node/dns/promises/setServers
点击访问原文链接

Node dns.promises.setServers function | API Reference | Bun

Node dns.promises.setServers function | API Reference | BunBuildDocsReferenceGuidesBlogDiscord/node:dns/promises/setServersFsetServers

Search the reference...

/

BuildDocsReferenceGuidesBlogDiscord/node:dns/promises/setServersFsetServers

function

dns.promises.setServersfunction setServers(servers: readonly string[]): void;

Sets the IP address and port of servers to be used when performing DNS resolution. The servers argument is an array of RFC 5952 formatted addresses. If the port is the IANA default DNS port (53) it can be omitted.

dnsPromises.setServers([
'4.4.4.4',
'[2001:4860:4860::8888]',
'4.4.4.4:1053',
'[2001:4860:4860::8888]:1053',
]);

An error will be thrown if an invalid address is provided.

The dnsPromises.setServers() method must not be called while a DNS query is in progress.

This method works much like resolve.conf. That is, if attempting to resolve with the first server provided results in a NOTFOUND error, the resolve() method will not attempt to resolve with subsequent servers provided. Fallback DNS servers will only be used if the earlier ones time out or result in some other error.

@param servers

array of RFC 5952 formatted addresses

Resources

ReferenceDocsGuidesDiscordMerch StoreGitHubBlog 

Toolkit

RuntimePackage managerTest runnerBundlerPackage runner

Project

Bun 1.0Bun 1.1Bun 1.2Bun 1.3RoadmapContributingLicense

Baked with ❤️ in San Francisco

We're hiring →

Node dns.promises.setServers function | API Reference | Bun,AI智能索引,全网链接索引,智能导航,网页索引

    API documentation for function node:dns/promises.setServers | Bun