When I want the fully qualified domain name on Linux, I can write …
To get the same thing on Solaris, is it necessary to write …
cut -f 2-3 /etc/hosts | grep ^`hostname`t | cut -f 2
… or is there something more brief?
hostnamecommand should return an FQDN…
The solution is to edit /etc/nodename and put the FQDN in there and reboot.
echo foo.your.domain.com > /etc/nodename
You might also be able to use:
getent hosts `hostname` | cut -f 3
- What is the difference between a hostname and a fully qualified domain name?
- Bash prompt on Ubuntu – FQDN (H) same as hostname (h)
- mod_unique_id: unable to find IPv4 address of FQDN despite setting etc/hosts and Apache ServerName
- How do I fully qualify my domain name?
- Apache: Automatic log splitting per Virtual Host?