What is the Solaris equivalent of the Linux hostname -f
command? On Solaris, when I type hostname
, I receive the short name but I need to get the FQDN.
Typing hostname -f
sets the short name to be "-f", and the manpage for hostname
is pitiful.
This is likely to work:
but it's not guaranteed. You can view the module source:
to see how it works (if you know Perl well enough).
If you are on a system that the DNS knows about, you could try this:
or, as suggested by a commenter, use "host" instead of nslookup:
I tested this successfully on Linux, Solaris, AIX, and HP-UX.