You should be able to get whois for almost any domain, actually there are regulations to make sure that's the case. But obviously it's not the case always. To do whois properly from command line, you have to first:
1) connect to whois using the -h switch with one of the servers on this list:
NOTE: each ending/tld has one "main registrar"
2) What you get in return, will include a field that gives you the whois server address of the registrar where the domain is actually registered.
NOTE: You can get the full registration information only from the registrar where the domain is actually registered.
If you run:
$ whois google.com
It will try to do this for you in the background (as far as I understand), but depending on the system and whois version, it's often not doing it well and might also be prone to being rate-limited.
Below a quick code example for doing whois "properly". I've tested it with a large number of sites, and it avoids the usual rate-limit issues and returns a much higher 'complete result' rate than any other method I had tried.
TLD=$(echo $DOMAIN | cut -d. -f2-)
WHOIS=$(grep -w ^$TLD whois_server.txt | cut -d ' ' -f2)
timeout 2 whois -h $WHOIS "domain "$DOMAIN"" | grep " " | grep -v "Status:" | tr ':' '=' | tr -d ' ' | tr '[a-z]' '[A-Z]' > whois.bash
REGIST=$(cat whois.bash | grep WHOISSERVER | cut -d= -f2)
timeout 2 whois -h $REGIST $DOMAIN | grep : | grep -w '^Admin City\|^Admin Country\|^Registrant Organization\|^Registrant Name' | tr [a-z] [A-Z] | sed 's/\ /_/' | sed 's/:/=("/' | tr -d ' ' | sed 's/$/")/' | tr '/' '_' >> whois.bash;