使用C#(dns)获取NS记录类型

时间:2009-06-30 00:40:34

标签: c# dns

只是想知道是否有办法在C#中获取NS记录。我在MSDN上阅读过,似乎有一个可以返回主机IP地址的DNS类。但是,我是在NS记录类型之后。

非常感谢

2 个答案:

答案 0 :(得分:3)

我记得,这个功能并没有内置在C#中。

但是,有一些无许可证和开源许可证组件将提供更丰富的DNS功能。

请检查此link。其他很容易找到Google / Bing。

答案 1 :(得分:0)

您可以使用SimpleDNS为查询类型提供结果 A CName MX NS SOA TXT

//Create your question - (Hostname,QueryType) 
var question = new Question("stackoverflow.com", QType.NS);

//Create your SimpleDnsPacket and pass to the Util method Kitson.Dns.Query 
var result = Query.Simple(new SimpleDnsPacket(question, IPAddress.Parse("8.8.8.8")));

<强>结果:

enter image description here

它也可以Nuget包的形式提供,并与.NetCore 2.0兼容。

相关问题