Recap: Debugging
Lesson 47 of 47 in Coddy's Networking with the Terminal course.
The method, in order, and each step rules something out.
Does the name resolve? If not, nothing was ever dialled.
Is the machine there? Ping, remembering that silence proves little.
Is the port open? nc -z. Refused is fast, dropped hangs.
Does the service answer? curl, and read the exit code: 0 talked, 7 refused, 28 timed out, 35 no TLS.
What did it say? The status code: 2xx worked, 3xx go elsewhere, 4xx fix your request, 5xx theirs is broken.
And when the request itself is in question, stop guessing: put a listener in the way and read exactly what was sent.
Challenge
The full ladder, one last time, against a server you start.
- Create
index.htmlcontainingservedand serve it on port 9134 - Print
name: okifgrep localhost /etc/hostsfinds anything - Print
port: okifnc -zfinds 9134 open - Print
status:and the status code of a request for/index.html - Print
body:and the page contents
Expected output:
name: ok
port: ok
status: 200
body: servedTry it yourself
This lesson includes a short quiz. Start the lesson to answer it and track your progress.
All lessons in Networking with the Terminal
6curl in Depth
Seeing the HeadersSaving ResponsesCustom HeadersStatus and Timingcurl Exit CodesRecap: curl Flags9Auth and Debugging
API Keys and BearerThe User AgentTimeouts and RetriesReading a FailureRecap: DebuggingPractice on your own: Terminal playground