Unable to access Solaris 10 box by hostname
Do you have a Solaris 10 (x86 or SPARC) box that you are able to connect to by IP address, but not by hostname? You might have spent hours trying to resolve this issue like me, but here is the quick and easy solution!
Assigning a hostname to a Solaris 10 machine
- Login to the command-line terminal of the Solaris 10 box
- Open the file /etc/default/dhcpagent in your favorite text editor, such as vi.
- Make sure that the line containing REQUEST_HOSTNAME is not commented out (remove the #) and has a value of ‘yes’. For example:
- Edit the /etc/hostname.interface file and add the following line:
- Type the following commands to clear the DHCP cache:
REQUEST_HOSTNAME=yes
inet hostname
interface is the name of the network interface to make the changes to (ex. bge0, nge0)
hostname is the name you want the machine to use
# ifconfig interfacedhcp release
# reboot
interface is the name of the network interface to make the changes to (ex. bge0, nge0)
If you still cannot access it by hostname…
- Ensure /etc/nodename has the desired hostname as the first and only line in the file
- Ensure /etc/hosts has the IP address and hostname of the machine