阿西河

所有教程

公众号
🌙
阿西河前端的公众号

我的收藏

    最近访问  (文章)

      教程列表

      抓包专区
      测试专区

      Node.js dns dnsPromises.setServers

      Node.js dns dnsPromises.setServers(servers)

      新增于: v10.6.0

      • servers < string[]> array of rfc5952 formatted addresses

      Sets the IP address and port of servers to be used when performing DNS resolution. The servers argument is an array of rfc5952 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.

      Note that this method works much like

      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.


      更多内容请参考:Node.js dns 域名服务器,或者通过 点击对应菜单 进行查看;


      目录
      本文目录
      目录