How do web browsers find out the MAC address? While reading through my textbook, I discovered that if you want to access a particular web page, your web browser will find out the IP address of the web server that hosts the web page and try and connect to it. It will then transfer a copy of the web page to your computer so that you may view it.

However, my concern is... I have discovered that the IP address enables data to be sent to the device's local area network, but in order for the data to be sent to the device itself, the MAC address is needed to transfer data from the local area network to the device.

BUT, in my textbook, nowhere does it say how the computer's web browser finds out the MAC address of the web server. It says that the computer finds out the IP address of the web server by using the Domain Name System (DNS).

So, how does the computer find out the MAC address of the server?

Answers would be much appreciated.
So, how does the computer find out the MAC address of the server?


It doesn't. The MAC address only has validity inside a local area network (LAN), which, as the name says, is local. Unless the destination IP address resides in the same network as your machine, what it does is create a packet destined to the target IP address and forward it to its default route, usually your router. (To do so it must obtain the router's MAC address too using ARP—but this is a different matter.) Obtaining the server's MAC address is the task of the final hop which is in the same LAN as the server; a machine notices it is the final hop by checking if the destination IP lies in the same subnet as its own.

It is only when the destination IP is in the same local network as your machine that the MAC address needs to be obtained. (And this is done using ARP too.) In this case, your computer just happens to be the final hop in the route to the server.