Understanding name lookup - DNS and /etc/hosts file
Anytime we refer to a host, then the first thing the operating needs to do is resolve that hostname into an IP address.
It will look /etc/hosts first - so you can define local mappings.
Then it will go to the distributed name server (DNS) system of the internet.
It can take a while.