如何查询DNS - nslookup [英] How to query DNS - nslookup
本文介绍了如何查询DNS - nslookup的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好,
通过使用.NET类,如何在不使用命令提示符窗口的情况下完成以下nslookup命令:
Hi all,
By making use of .NET classes, how can I accomplish the following nslookup command without making use of the command prompt window:
C:\Users\userA>nslookup
Default Server: server.domain.local
Address: 192.168.0.1
> set type=srv
> _ldap._tcp.domain.local
Server: server.domain.local
Address: 192.168.0.1
_ldap._tcp.domain.local SRV service location:
priority = 1
weight = 1
port = 0
svr hostname = requiredServerName.domain.local
requiredServerName.domain.local internet address = 192.168.0.2
>
非常感谢提前。
亲切的问候,
Many thanks in advance.
Kind regards,
推荐答案
这个例子 [ ^ ]页面应该给你一个想法。
The examples on this[^] page should give you the idea.
大家好,
这是怎么做的:
从CodePlex下载以下程序集: DnDns和PocketDnDns - .NET DNS客户端解析程序库 [ ^ ]
实现以下代码(DnsQueryResponse
包含所有需要的信息):
Hi all,
This is how to do it:
Download the following assembly from CodePlex: DnDns and PocketDnDns - A .NET DNS Client Resolver Library[^]
Implement the following piece of code (DnsQueryResponse
contains all the desired information):
DnsQueryRequest request = new DnsQueryRequest();
DnsQueryResponse response = request.Resolve("192.168.0.1", "_ldap._tcp.domain.local", DnDns.Enums.NsType.SRV, DnDns.Enums.NsClass.ANY, System.Net.Sockets.ProtocolType.Tcp);
亲切问候,
Kind regards,
这篇关于如何查询DNS - nslookup的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文