So far in this track, sites were opened by address. A colleague set up an internal site and writes: "It opens at 127.0.0.10, but not as web.lab.test. Can you take a look?" Compare the two requests yourself.
Start on the card brings the site up on this machine. curl requests the page at a URL and prints the site's answer.
The site by address and by name
A colleague gave you the address and the name of an internal site. Request the /health page by address first, then by name.
First, predict
The site answers by address. What will the request by the name web.lab.test print?
Now start the exercise, run the command and compare your prediction with the output.
Why did the site answer by address while by name curl printed Could not resolve host?
-
The request by name never reached the site:
curlfound no address and did not start connecting. -
The site runs on this very machine and answered by address without the internet. A name can be found without the internet too — from a DNS server on your own network.
-
A port accepts connections to an address and never sees the name. The request by name never reached the port.
Could not resolve host means curl got no address for web.lab.test and never reached the site.