How does DNS caching work and what are TTL values?

Technical