Add DNS caching function.