客户端操作系统上的 DNS 查询是否已序列化?

发布于 2024-10-07 10:10:09 字数 456 浏览 0 评论 0原文

即使您在 Linux 或 Windows 上(以编程方式)发出多个并行异步 DNS 解析请求,操作系统是否会序列化这些请求并且不会将它们全部并行发送出去?

正如我在 gethostbyname 或 DnsResolve API 在最低层序列化的地方读到的那样,甚至有人编写了这个 async-dns python 库来显着加快 DNS 解析

http://www.catonmat.net/blog/asynchronous-dns-resolution

所以没有任何 .NET API 或一般情况下它可以按照以下方式并行工作我的程序发出的请求数量?

想象一下网络爬虫场景,我每秒需要大量的 dns 查询,在一些早期的网络爬虫出版物中,提到 dns 成为瓶颈。

Even if you give out multiple parallel async DNS resolution requests (programmatically) on Linux or windows, do the OS serialize the requests and does not send them out all in parallel ?

As i read at places that gethostbyname or DnsResolve APIs are serialized in lowest layer, even someone has written this async-dns python library to dramaticcally speed up DNS resolutions

http://www.catonmat.net/blog/asynchronous-dns-resolution

So isnt there any .NET API or in general where it can work parallely as per the number of requests given by my program ?

Imagine a webcrawl scenario where i would need lot of dns queries per second, in some early web crawl publications , it is mentioned that dns becomes bottleneck.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

只有影子陪我不离不弃 2024-10-14 10:10:09

在 Linux 下,gethostbyname() 将被有效地序列化,尤其是因为它在得到答案之前不会真正返回给调用者。然而,这只是取决于库的实现,而不是操作系统来做这件事。

还有许多其他库可以替代 gethostbyname,它们确实执行完全异步解析,允许同时进行多个查询。一个特别好的此类库是 libunbound,它是 Unbound 递归 DNS 服务器分发的一部分。

Under Linux, gethostbyname() will effectivly be serialised, not least because it doesn't actually return to the caller until it has an answer. However it's just down to the library implementation, it's not the O/S that does this.

There are plenty of other libraries which can replace gethostbyname which do perform completely asynchronous resolution, allowing multiple queries to be in progress at once. A particularly good such library is libunbound, which is part of the Unbound recursive DNS server distribution.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文