No, there is not.
Specifically because the remote nameserver you are querying may be an authoritative one (then your request is either rejected or served with content the nameserver has locally as it is authoritative) or a recursive one (then your request could be immediately fulfilled by content of the cache or the recursive nameserver would need to do one or more iterative queries to find out the result you asked for). And before having the reply you have no way to know if the given nameserver is authoritative or recursive, for your specific request.
But why do not need to have this information?
The only remedy is to run your own recursive nameserver and let it do the iterative queries to authoritative nameservers. You can then control its cache per your liking. You already mention dnsmasq
in your tags, so you know the direction to follow.