Friday, September 6, 2013

bash: How to get FQDN, host name, domain name

So you need a way to display a machine's FQDN in bash -- easy enough:
# hostname --fqdn

Alternatively, if you want just the hostname or just the domain name:
# hostname
# dnsdomainname

More information:
# man hostname

No comments:

Post a Comment