the title may be a little bit confusing, but I don’t know how to explain easier or different. I’m writing a local Proxy Server in C# right now. When a HTTP-Request started by Browser and redirected by Proxy is answered by the according Web Server a bunch of new HTTP-Requests is launched by the Browser, (Can you tell me how the Browser knows, what to reload, and how this works) pictures for example. What I need to know is: Do I have to start a DNS Request for every single reloaded Object or is it possible to use the IP-Adress from the first HTTP-Request?
Greets, Thomas
From Wikipedia:
So while the TTL has not expired yet, you can reuse the resolved IP address(es) without performing a new DNS lookup. When the TTL has expired, you need to perform a new DNS lookup.
The Dns Class does not expose the TTL associated with the IP addresses and I’m not sure if it caches the IP addresses. You could check if it performs caching, e.g., by looking at the traffic using Wireshark. If it does, just call the Dns Class methods every time. If not, implement your own DNS client or grumble and call the Dns Class methods every time.