修改DNS组件

This commit is contained in:
fofolee
2025-01-07 18:19:25 +08:00
parent a13580d53f
commit 807da38e2e
7 changed files with 221 additions and 251 deletions

View File

@@ -13,9 +13,9 @@ const resolveCname = promisify(dns.resolveCname);
const reverse = promisify(dns.reverse);
// 解析主机名
async function lookupHost(hostname, options = {}) {
async function lookupHost(hostname, family = 0, all = false) {
try {
return await lookup(hostname, options);
return await lookup(hostname, { family, all });
} catch (error) {
throw new Error(`DNS查询失败: ${error.message}`);
}