Skip to content

Instantly share code, notes, and snippets.

@jsstrn
Last active February 21, 2019 16:21
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save jsstrn/f506858434c167f56963feb64adec957 to your computer and use it in GitHub Desktop.
Lab: How the web works

🌐 Lab: How the web works

IP Address

We've learned that each device connected to a network is assigned an IP address. This includes your mobile phones and computers, and if you have a toaster that's hooked up to the Internet then your toaster, too.

What's the IP address of your computer?

Use ipconfig from your Terminal

In your Terminal, type ipconfig getifaddr en0 to check the local IP address that your WiFi router has assigned to you on the network.

Go to ifconfig.me

Either type curl ifconfig.me or simply go to ifconfig.me from your browser. This shows you your public IP address.

πŸ™‹β€β™€οΈ Why do you have two IP addresses?

πŸ™‹β€β™€οΈ Check to see if the IP addresses are the same as your classmates. Which are the same and why?

What's the IP address of a website?

Since servers are computers, too, they would have an IP address.

Let's try to find out what the IP address of facebook.com is. There are several ways to do this.

Use an online tool

Try using different online tools to find the IP adress of facebook.com like this one.

πŸ™‹β€β™€οΈ Are their results the same? If they are different, why might that be?

Use nslookup from your Terminal

In the Terminal, we can type nslookup facebook.com to check for its IP address.

πŸ™‹β€β™€οΈ Compare what you get with the online tool you used earlier. Are their results the same? If they are different, why might that be?

Navigating to a website via its IP address

Now try typing in the IP address directly into the browser. If you have multiple IP addresses, try them all and see where they take you.

Use traceroute from your Terminal

In your Terminal, we can type traceroute facebook.com to observe the journey your computer takes to get to a particular website.

πŸ™‹β€β™€οΈ How many hops does it take to get to facebook.com?

πŸ™‹β€β™€οΈ If you're connected to a VPN, try this with and without your VPN connection and see if there is a difference.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment