Is is possible to send one or more additional records with a DNS response?

For example, can a request for the A record of www.example.com result in a response containing the A record for www.example.com as well as the A record for www2.example.com?

Is this compliant with the standard? Will it even help? ie. Will the typical client cache the additional record so that when it needs it in the near future, it won't result in another round-trip to the DNS server?


The longer answer is yes, it's technically possible, but you shouldn't.

DNS servers put additional records in what's called (unsurprisingly) the "additional" section of the response.

Strictly speaking, though, according to RFC 1034, the additional section "carries RRs which may be helpful in using the RRs in the other sections". For example, if you ask for the NS records for a domain, the A records belonging to those name servers might come along for the ride.

However if you try to supply unrelated data your DNS clients and caches will generally throw it away. RFC 2181 gives a priority table showing how "trustworthy" DNS clients should treat different sorts of data. Specifically it also says:

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.

i.e., data you put in the additional section can never be promoted into real answers.

| improve this answer | |

The short answer is no.

If you are concerned about response time from DNS then you should deploy a caching DNS Server closer to the clients, or improve infrastructure. I would like a bit more info. Do you admin DNS or clients or both? Generally DNS latency is not an issue, so I wonder why it is for you?

or perhaps

You can set a longer TTL, meaning less refreshing of the records. If you control the clients you are worried about, you could run a script that resolves and thus caches the dns, or you could deploy a hosts file to all the clients (I would not recommend this).

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.