Basic question re DNS prefetching

During DNS prefetching, is any connection made to the host website or only to the DNS servers?

DNS only involves queries to DNS servers. It wouldn’t be very useful otherwise.

Your computer can’t access the host site until it knows where it is. The domain name in the URL (boards.straightdope.com for example) is meaningless to a computer. The computer uses DNS to translate the name into numbers that the computer can use.

The computer starts by looking in its local hosts file. Very few people have much of anything in their host files these days, so most of the time this doesn’t do anything useful. The computer then sends a DNS request to whatever is configured as the computer’s DNS server, which is typically a computer on your internet provider’s network. Most of the time, the ISP’s DNS server will have an entry for whatever your computer is looking for. However, if the ISP DNS computer doesn’t have an entry for the domain name, then it forwards the request up the DNS hierarchy. At the top of the DNS hierarchy are the DNS root servers. They are the ones with the master list for every computer on the internet. If they don’t know where the domain is, no one does, and the DNS request fails.

There are 13 root servers for the internet, given the letters A through M. Each “server” is actually a combination of computers in a fault-tolerant redundant configuration, but that’s probably more detail that you wanted to know.

Anyway, now that your URL is translated into a number, now your computer can send a message to that domain.

So the short answer is no, your computer does not make any connection to the host computer during the DNS lookup because your computer doesn’t know where the host computer is yet.

The OP asked about DNS pre-fetching

Ok, thanks. Just to make sure I understand correctly…let’s say you are on a search results page with a bunch of links on it. The DNS prefetching would happen before you click on anything in order to resolve the links to actual IP addresses that a computer can understand. Then once you click on a link, that would be the first time your computer actually contacts the host, correct?

In theory, yes, but in practice it depends on what is actually doing the prefetching. Some browsers/phones/apps will prefetch not just DNS but also part of the page content to help speed up loading. So look into the docs for whatever app you’re using.

Are you talking about stuff like prerender in Chrome where it will load a page in the background if it predicts you’ll click on it next? I was just talking about the actual DNS lookup itself.

Yes, exactly. It depends on what your browser is pre-fetching. There is no rule in DNS that determines how clients choose to do it… if they are only pre-fetching DNS, then yes, your computer shouldn’t make any contact with the actual hosts until and unless you click on them. But I think many browsers pre-fetch more than just DNS.

If you want to be sure, download Wireshark and monitor traffic to those IPs during the DNS-prefetch process.

Then that would not be DNS pre-fetching.

Uh-huh.

The Internet Society has a document explaining DNS for non-experts.