Ranking Data
レコードの選択について
DNS のリソースレコードは様々な形で受け取りうる。キャッシュに入っている場合それを更新するか否かなど、優先順位を付ける必要がある。 これは、 DNS の細々したアップデートや補足について記載のある RFC 2181 にて記載がある。
RFC 2181 Clarifications to the DNS Specification https://tools.ietf.org/html/rfc2181#section-5.4.1
The accuracy of data available is assumed from its source.
Trustworthiness shall be, in order from most to least:
+ Data from a primary zone file, other than glue data,
+ Data from a zone transfer, other than glue,
+ The authoritative data included in the answer section of an
authoritative reply.
+ Data from the authority section of an authoritative answer,
+ Glue from a primary zone, or glue from a zone transfer,
+ Data from the answer section of a non-authoritative answer, and
non-authoritative data from the answer section of authoritative
answers,
+ Additional information from an authoritative answer,
Data from the authority section of a non-authoritative answer,
Additional information from non-authoritative answers.上に書いてる通りだが、和訳する。 上から順に、優先度が下がっていく。
+ プライマリゾーンファイルから返されたデータ (Glue を除く)
+ ゾーン転送により受け取ったデータ (Glue を除く)
+ 権威ある応答として権威サーバから返された answer section のデータ
+ 権威ある応答として返された authority section のデータ
+ プライマリゾーンまたはゾーン転送により受け取った Glue のデータ
+ Non-authoritative な応答として返された answer section のデータ、
および権威ある応答として返された answer section についての non-authoritative なデータ
+ 権威ある応答として返された additional なデータ、
Non-authoritative な応答として返された authority section また additional section のデータ「権威ある応答として返された answer section についての non-authoritative なデータ」ってなんぞや、と思ったけど CNAME を指してるっぽい。 CNAME 自体は権威ある応答だが、その先が権威ある応答ということを保証するものではない。 以下の箇所にて (see section 10.1.1) と書かれているところが CNAME に飛ぶ。 -> https://tools.ietf.org/html/rfc2181#section-10.1.1
Note that the answer section of an authoritative answer normally
contains only authoritative data. However when the name sought is an
alias (see section 10.1.1) only the record describing that alias is
necessarily authoritative. Clients should assume that other records
may have come from the server's cache. Where authoritative answers
are required, the client should query again, using the canonical name
associated with the alias.次にキャッシュについて。 優先度が最下位 (the least trustworthy) なものについては、聞かれたクエリに対する応答として返すような内容としてキャッシュすべきではない。 これらは additional additional として返される場合がある。
Unauthenticated RRs received and cached from the least trustworthy of
those groupings, that is data from the additional data section, and
data from the authority section of a non-authoritative answer, should
not be cached in such a way that they would ever be returned as
answers to a received query. They may be returned as additional
information where appropriate. Ignoring this would allow the
trustworthiness of relatively untrustworthy data to be increased
without cause or excuse.DNSSEC についても軽く書かれてたが、はっきり言って古すぎるのでここでは抜粋しない。
その他資料
RFC 2181 Ranking data and referrals/glue importance https://indico.dns-oarc.net/event/25/contributions/415/attachments/385/657/fujiwara-201610160810.pdf
Last updated