To do this, your browser queries a program called a name server . The name server may live on your machine, but it's more likely to run on a service machine that yours talks to. When you sign up with an ISP, part of your setup procedure will almost certainly involve telling your Internet software the IP address of a nameserver on the ISP's network. Here's how that happens. Your packet may pass through several routers on the way to its destination.
Routers are smart.
They watch how long it takes for other routers to acknowledge having received a packet. They use that information to direct traffic over fast links. There's an urban legend that the Internet was designed to survive nuclear war. This means that failures tend to be well localized and the network can route around them. Once your packet gets to its destination machine, that machine uses the service number to feed the packet to the web server.