You seem to understand it correctly.
HTTP requests from your web browser are packaged into TCP segments, and those TCP segments are packaged into IP datagrams. The IP header at the beginning of the datagram needs to have a source and destination IP address—the numeric IP address. There's no way to put the hostname of a server (i.e. its Fully Qualified Domain Name or FQDN, like "www.yahoo.com") as the destination address in the IP header. The destination address in an IP header can only be a numeric IP address.
Your machine knows the IP addresses of one or more DNS servers because you either typed it in manually, or it got automatically set via some protocol such as DHCP or PPPoE. It's one of the few pieces of configuration information that an Internet-connected machine must have in order to work properly on the Internet.
So, when you direct your web browser to a URL, your browser parses the URL to find the host name, and then sends a DNS query to the IP address of the DNS server in order to translate that host name into an IP address. Once your browser gets back the answer to its DNS query, it is able to create the HTTP-in-TCP/IP packets it needs to create to send its first HTTP request off to the server.
The DNS query software on your client machine (sometimes called the "DNS resolver" software) caches DNS answers for a period of time, so if you spend a lot of time surfing the same website, you're not making DNS queries for every click on the same website. You just made one query the first time your browser needed something from that website, and then your machine remembers its IP address for minutes to hours.
1No => Time To Live. – ta.speot.is – 2014-02-11T07:37:26.593
I couldn't understand. – dexterous – 2014-02-11T08:36:59.753