本文介绍了SRV记录顺序的DNS服务器中检索的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我必须做出对Android应用程序SRV记录DNS查找并选择其中的选择之一。
当我查询多个SRV记录的DNS服务器中的优先级和权重不同,我得到关于每个请求以不同的顺序的记录,在这些记录由服务器有序?如果是的话是什么顺序算法?

I have to make a DNS lookup for SRV records in Android application and choose the select one of them.When I query a DNS server for multiple SRV records differ in priority and weight, I get the records in different order on each request, are these records ordered by the server? if yes what is the order algorithm?

我猜对了尊重优先级较低的优先级是最preferred,但如果优先级等于我以为它会尊重在循环赛风格,没有发生重!

I guessed it respects the priority as the lower priority is most preferred, but in case the priority is equal I supposed it will respect the weight in a round-robin style, which did not happen!

我做了一个简单的BIND9 DNS服务器2 SRV记录如下:

I had a simple bind9 DNS server with 2 SRV records as follow:

域优先级重量

aaa.example.com 1 90

aaa.example.com 1 90

bbb.example.com 2 10

bbb.example.com 2 10

当我查找时,我期望得到的 aaa.example.com 9 倍,第一个结果,并在 10 我会得到 bbb.example.com 的第一个作为结果,没有发生!在服务器刚刚逆转每个请求的顺序!

When I lookup, I expected to get the aaa.example.com 9 times as first result and the 10th I would get bbb.example.com as first result, which did not happen!, the server just reverse the order on each request!

推荐答案

如果您要查询SRV记录,它们所返回的顺序是任意的,不应不是由您的客户端应用程序加以考虑。

If you are querying for SRV records, the order in which they are returned is arbitrary and should not not be taken into account by your client application.

相反,您的应用程序负责根据重量和优先订购收到了成效,如。

Rather, your application is responsible for ordering the received results according to weight and priority, as specified in RFC 2782.

另外,在RFC指定的是,如果多个记录用相等重量和优先返回时,客户端会随机根据其中被返回那些记录的顺序进行选择,而不是

Also specified in the RFC is that if multiple records are returned with equal weights and priorities, the client would select randomly, and not according to the order in which those records are returned.

其结果是,使用循环DNS的投放SRV记录是多余的。

As a result, the use of round-robin DNS to serve SRV records is redundant.

这篇关于SRV记录顺序的DNS服务器中检索的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-04 01:39
查看更多