2013-09-07

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
fiala.kytky.cz

Alternatively, if you want just the hostname or just the domain name:
# hostname
fiala
# dnsdomainname
kytky.cz

More information:
# man hostname

No comments:

Post a Comment