-2

I have come across a problem.

A web page contains images. Before retrieving each image, does your host issue new DNS queries?

I have found answers in google. But I got two different answers. Some one think it will(https://maxwellsullivan.wordpress.com/2013/02/28/wireshark-lab-3-dns/) while others thinks not(https://maxwellsullivan.wordpress.com/2013/02/28/wireshark-lab-3-dns/).

I can not make decision which is right. I hope someone will provide some solid evidence. Thank you!

HannanKan
  • 163
  • 2
  • 14

1 Answers1

1

Generally not, but the answer is usually, "it depends". DNS queries may be cached in any of a number of places:

  • Your browser, or other application making the query.
  • Your operating system
  • Your local network router or dns server
  • Your ISP's nameservers
  • Other internet nameservers

In your case of multiple images on a single page, chrome will cache the dns record and use it for all of them. This question has some details. It looks like chrome will cache for ~30 seconds, and after that expires it will hit your local system resolver, which may have it cached longer depending on your configuration. Only if that fails will it go out over the network and make further DNS requests.

captncraig
  • 22,118
  • 17
  • 108
  • 151
  • yeah, you are right. But something you haven't mentioned. In some cases, pics even in one web are in the same URL with HTML; so after being caching, the URL has no need to be translated into ip. In other cases, if pics in one web don't share the same URL with HTML or other elements, multiple queries will be issued. You can find each element's URL by pressing F12 before you browserring website. – HannanKan Oct 25 '17 at 13:29
  • Yes, lookups are done per host. If you see something new, you need to look it up. If you already have it, you don't. – captncraig Oct 25 '17 at 13:31
  • I just find the answers by talking with my classmates and I also want to know others' answers too. – HannanKan Oct 25 '17 at 13:54