hostname on Solaris


 
Thread Tools Search this Thread
Operating Systems Solaris hostname on Solaris
# 1  
Old 07-15-2009
hostname on Solaris

Hi All,

I am wondering how does the hostname command decides what is the actual hostname. Where does the command take the information from?
# 2  
Old 07-15-2009
From /etc/ hostname.<interface> name is the file which hostname command read to decide the hostname of the system.
# 3  
Old 07-15-2009
I don't have access to a Solaris system right now to check for sure, but the contents of /etc/nodename are probably important, too.
# 4  
Old 07-15-2009
Quote:
From /etc/ hostname.<interface> name is the file which hostname command read to decide the hostname of the system.
Actually not, especially as you can have plenty of physical interfaces but have only one hostname at a given time.

Hostname initial setting is done by reading the /etc/nodename file.
DHCP, bootp or root might change the hostname later.
# 5  
Old 07-15-2009
Quote:
Originally Posted by lmishkind
I am wondering how does the hostname command decides what is the actual hostname. Where does the command take the information from?
On Solaris the `hostname` command is a shell script that runs `uname -n` (and uses `uname -S ${1}` to set the hostname). I ran a `truss uname -n` to see if I could spot the location in memory or disk easily but I was not able to figure that out.

During boot the sysid tools check /etc/nodename and set the hostname of the system to the contents of that file.
# 6  
Old 07-16-2009
Quote:
Originally Posted by seg
On Solaris the `hostname` command is a shell script that runs `uname -n` (and uses `uname -S ${1}` to set the hostname). I ran a `truss uname -n` to see if I could spot the location in memory or disk easily but I was not able to figure that out.
The uname command uses the uname system call. The host name is stored in a kernel structure named "utsname".
# 7  
Old 07-20-2009
Quote:
Originally Posted by jlliagre
DHCP, bootp or root might change the hostname later.

True. But the change still has to be saved somewhere
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Solaris

Solaris Hostname

Hi, I am installing Solaris 11.3 as a local system using no remote connections. The installer asks for a computer name or would be used as the hostname. Can I select any name ? Like solaris 11 or localhost ? I noticed this is added into the /etc.hosts file later. ie example. localhost ... (2 Replies)
Discussion started by: dylan69
2 Replies

2. UNIX for Dummies Questions & Answers

Solaris - How to get IP Address from a hostname?

We are using Solaris as our database OS. Can you please help me to know how can i get the IP address of a solaris machine in my network from its hostname? e.g. We have a remote database server with the hostname as xyz. Without connecting to the database OS, can i get the IP address of xyz OS from... (1 Reply)
Discussion started by: Anmol Sharma
1 Replies

3. Solaris

changing hostname on Solaris 8 ?

hi, does anyone had experience changing hostname on Solaris 8 ? any idea how is it done ? (4 Replies)
Discussion started by: Exposure
4 Replies

4. Solaris

Can't ping using hostname on Solaris 10

I recently installed Solaris 10 on my Sun workstation. I cannot ping using hostname from another computer on the same network. But I can ping using the IP address. Also I can ping other systems using their hostnames. Can anyone give some information regarding how to resolve this issue. (4 Replies)
Discussion started by: alpha123
4 Replies

5. Solaris

changing ip and hostname on solaris

dears does any one know in steps how can i change ip and hostname on solaris (10 Replies)
Discussion started by: murad.jaber
10 Replies

6. UNIX for Advanced & Expert Users

Map IP to hostname on Solaris 10

I am seeking help. We have a UNIX sparc box with Solaris 10 on it. We configured this box as 3 zones with 3 static IP address. I installed Oracle 10g on glabal zone successfully. Now Oracle DBConsole can be started successfully, but it can not find IP for global zone and also can not identify... (0 Replies)
Discussion started by: duke0001
0 Replies

7. Solaris

Change hostname in Solaris 9

Please anyone guide me how to change the hostname in Solaris 9? The IP of the machie is fetched from a DHCP server. (6 Replies)
Discussion started by: shabu
6 Replies

8. UNIX for Dummies Questions & Answers

Solaris - unknown hostname - how can I change hostname?

Hello, I am new to Solaris. I am using stand alone Solaris 10.0 for test/study purpose and connecting to internet via an ADSL modem which has DHCP server. My Solaris is working on VMWare within winXP. My WinXP and Solaris connects to internet by the same ADSL modem via its DHCP at the same... (1 Reply)
Discussion started by: XNOR
1 Replies

9. IP Networking

How to change hostname and ip in solaris

Dear all, I am going to change the IP address and hostname in my solaris, but I don't know how to do it. If you have any idea or suggestion, please fell free to let me know. Thanks and Regards (2 Replies)
Discussion started by: PennyLi
2 Replies
Login or Register to Ask a Question