The telnet
command connects to the host you specify as the first argument on the port you specify as the second argument (or 23, if you only specify a single argument).
When you tried to execute telnet port
, it tried to connect to the server port
on port 23. Since there is no server with the address port
(unless you specified it in your pc's hosts file), telnet
couldn't connect to it.
I'm guessing the second command failed, because www.udacity.com
doesn't accept connections on port 8080 (the second argument of the command).
I don't see any instructions in the link you provided.
EDIT: If you're trying to connect to localhost, use telnet localhost
(to connect to port 23) or telnet localhost <port>
(replace <port>
with the port you are trying to connect to).