简体   繁体   English

如何在NodeJS中获取DNS服务器IP地址

[英]How Do I Get DNS Server IP Address In NodeJS

I'm working on a project and stuck in the DNS Leak Tool, where I would have to perform the same task as http://dnsleak.com/ these website doing, is there any logic, where I can get fetch DNS server IP? 我正在研究一个项目,并停留在DNS泄漏工具中,在这里我必须执行与http://dnsleak.com/这些网站相同的任务,是否有任何逻辑可以在其中获取DNS服务器IP ?

Really appreciate if you guys can help! 非常感谢你们的帮助!

Regards, Finn 问候,芬

I think you just have to do something like this : 我认为您只需要执行以下操作:

const dns = require('dns');

dns.getServers();

See documentation for more information. 请参阅文档以获取更多信息。

Hope it helps. 希望能帮助到你。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM