On Solaris, what is a terse way to get the fully qualified domain name (fqdn) for the current host
When I want the fully qualified domain name on Linux, I can write …
hostname --fqdn
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?
From here:
The
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
or similar.
Check more discussion of this question.
Related posts:
- 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?
Leave a comment
Recent Posts
- Understanding redundant power supplies
- Is there a way for administrators to disable users from installing Firefox extensions?
- Is there research material on NTP accuracy available?
- How to create a limited “domain admin” that does not have access to domain controllers?
- Can Windows RDC admin users be immune from being kicked?
Tags
active-directory
amazon-ec2
apache
apache2
backup
bash
centos
cisco
command-line
debian
dns
email
exchange
firewall
iis
iis7
iptables
linux
macosx
monitoring
mysql
networking
nginx
performance
permissions
php
postfix
raid
security
sql-server
sql-server-2005
sql-server-2008
ssh
ssl
ubuntu
unix
virtualization
vpn
webserver
windows
windows-7
windows-server-2003
windows-server-2008
windows-server-2008-r2
windows-xp





