例如,对www.example.com的A记录的请求是否会产生包含www.example.com的A记录以及www2.example.com的A记录的响应?
这符合标准吗?它会帮助吗?即.典型的客户端是否会缓存附加记录,以便在不久的将来需要时,它不会导致另一次往返DNS服务器?
解决方法
DNS服务器将额外的记录放在响应的“附加”部分(不出所料).
严格地说,根据RFC 1034,附加部分“携带RR可能有助于在其他部分使用RR”.例如,如果您要求域的NS记录,那么属于这些名称服务器的A记录可能会出现.
但是,如果您尝试提供不相关的数据,您的DNS客户端和缓存通常会将其丢弃. RFC 2181给出了一个优先级表,显示了“值得信赖的”DNS客户端应如何处理不同类型的数据.具体而言,它还说:
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.
也就是说,您在附加部分中放入的数据永远不会被提升为真正的答案.