简体   繁体   English

Dns.GetHostEntryAsync方法是否可以避免在FQDN中搜索IPV6机器,而仅限于IPV4服务器

[英]Can Dns.GetHostEntryAsync method avoid searching FQDNs for IPV6 machines and be limited to IPV4 servers only

I am using an application to get the FQDNs for a list of servers based on their hostname. 我正在使用一个应用程序根据其主机名获取服务器列表的FQDN。 There seems to a bottleneck to the solution, the FQDN search requires IPV4 address only as there are no IPV6 machines used across the network. 解决方案似乎存在瓶颈,FQDN搜索仅需要IPV4地址,因为网络上没有使用IPV6机器。 The additional lookup of IPV6 are taking more time to find the host FQDNs which delays the execution time as a whole. IPV6的额外查找需要花费更多时间来查找主机FQDN,这会整体延迟执行时间。 Can the IPV6 serach be avoided using Dns.GetHostEntryAsync method? 可以使用Dns.GetHostEntryAsync方法避免IPV6搜索吗?

I'm not sure this is supported. 我不确定是否支持。

You can use ARSoft.Tools.Net library for better DNS powers. 您可以使用ARSoft.Tools.Net库获得更好的DNS功能。 I've used this in some very demanding situations. 我在某些非常苛刻的情况下使用了此功能。 It works (and is really asynchronous, unlike .NET's DNS , which isn't really asynchronous ). 它可以工作(并且实际上是异步的,与.NET的DNS不同, 后者不是真正的异步 )。

For instance: 例如:

var answer =  await DnsClient.Default
                 .ResolveAsync(DomainName.Parse("www.google.com"), RecordType.A);
var addresses = answer.AnswerRecords
                      .OfType<IAddressRecord>()
                      .Select(r => r.Address);

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

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