Indeed, as the /list command, /whois only works if you are actually connected to a server.
Doing a whois means you are querying the server for information about the person you whois'ed, which then sends this information back to your client.
Since this is a server query, you must be connected.
To do a whois:
/whois <nickname> without the < >
If you want to see a person's idle time included in the whois, you'll have to do /whois <nickname> <nickname>
Greets