Still need help with changing hostname on Solaris 10
Hello.
I have some difficulties with changing host name of my computer.
It is DHCP Client.
AS I understand there are the following steps that I have to do:
1. Edit the /etc/default/dhcpagent file and change the line that reads the following:
#REQUEST_HOSTNAME=no
to
REQUEST_HOSTNAME=no
2. There are two empty /etc/hostname files: hostname and hostname6.
Do I have just to put there hostname?
3. /etc/hosts has what I need to change.
4. I was unable to find /etc/nodename. Do I have to create it? What properties should contain this file?
5. hostname <new hostname>
In previous time when I tried to change host name with Management Console my system crashed, I changed: /etc/hosts, but it didn't work.
Thank you.
# 1
> 1. Edit the /etc/default/dhcpagent file and change
> the line that reads the following:
>
> #REQUEST_HOSTNAME=no
> to
> REQUEST_HOSTNAME=no
This is slightly wrong, if you do this your DHCP client will request an address related to that hostname from the DHCP server (or possible request the DHCP server to set a particular hostname of the address which it got).
In the bottom of /etc/default/dhcpagent you have a field called PARAM_REQUEST_LIST, what you should do is to remove the value "12" from this list, and then put the desired hostname into /etc/nodename.
hope this helps
.7/M.
# 2
The problem is, that there is no /etc/nodename file on my computer and hostname files are empty.
There is file /etc/inet/ipnodes.
Maybe if I'll create nodename and fill it with required information it will work?
Could you please provide me /etc/nodename template?
As well I'll need template for hostname.<interface> and hostname6.<interface>.
# 3
if you use dhcp the hostname.<interfaces> files should be blank, if you are not running dhcp on all interfaces, the hostname.<interface> file of the non-dhcp interface should contain the ipaddress of the interface.
The contents of the /etc/nodename is simply the hostname, just the hostname, and nothing but the hostname :)
aka:
foobar # cat /etc/nodename
foobar
foobar #
.7/M.
# 4
I changed settings of: /etc/default/dhcpagent
added file /etc/nodename
and edited /etc/hosts
On every boot /etc/hosts turns back to be the same: hostname "unknown".
I tryed to use "hostname" command, but it works temporary until the first boot and causes crashes of services - system becomes non functional.
Could you tell me please what did I miss?
# 5
Did you re-add a "#" infront of REQUEST_HOSTNAME in /etc/default/dhcpagent? .7/M.
# 6
Yes. Actually from the beginning there was # REQUEST_HOSTNAME .Later I tryed without # - same result.
# 7
Have a look in /etc/inet/ipnodes, which is the IPv6 versionof /etc/hosts. This is read *before* /etc/hosts.
# 8
Have you tried 'sys-unconfig'? It seems like this would accomplish what you want to do.man sys-unconfig
# 9
I used sys-unconfig and after that modified files:
/etc/nodename
/etc/hosts
/etc/inet/ipnodes
/etc/inet/hosts
Host name changed, but there are new problems:
1. Only root can use the system
2. Solaris Management Console does not work (in the status bar seen that it tryes to load from hostname: "unknown")
3. Normal user gets message:
"The DT messaging system could not be started
1.............
2.............
3. Check to see that the hostname is correct in these locations:
/etc/src.sh
/etc/hosts/
/usr/adm/inetd.sec"
I checked files that I modified, they all are correct.
There are no files: /etc/src.sh and /usr/adm/inetd.sec in my system.
Do I have to create them? If yes, what to put in?
I think that there is another place where I have to modify the hostname.
Could you tell me please where?
# 10
> I used sys-unconfig and after that modified files:
> /etc/nodename
> /etc/hosts
> /etc/inet/ipnodes
> /etc/inet/hosts
I don't think you would need to modify any files after running sys-unconfig. It has worked for me in the past just by running this command. Maybe try running it again and not modifying any files afterward and see what happens.
SMC is a problem after running sys-unconfig, since it attempts to load the original toolbox named 'unknown'. I had this same problem. I eventually figured out how to create a new toolbox and have it loaded by SMC (forgot what I did, I no longer use SMC because it is not compatible with md5 passwords). The OS doesn't seem to like having the hostname changed. It is best to do this first thing before doing anything else. I have noticed that setting the hostname during the original configuration does not stick. I am currently at 'unkown' as well and decided it wasn't worth the effort to change. Also, if you register your system with unkown as the hostname you should unregister that name and then re-register with your new name.
# 11
The problem with sys-unconfig, that there was no plase to input a hosname.
I changed path of SMC and it loaded. But I have no access to users, processes nd other things. The only thing that works correctly is networking.
The question is: will sys-unconfig keep the hosname that I managed to set?
I did not make any settings in the OS.
The only thing that I'm trying to do since setup is to set the hostname.
# 12
> The problem with sys-unconfig, that there was no
> plase to input a hosname.
Sorry about that, I thought that there was since that is the recommended way to change the hostname. I have done this before using sys-unconfig.
> I changed path of SMC and it loaded. But I have no
> access to users, processes nd other things. The only
> thing that works correctly is networking.
Don't know about this. I have had difficulty with SMC and don't use it now.
> The question is: will sys-unconfig keep the hosname
> that I managed to set?
Only if you set if during sys-unconfig or after. Setting it before sys-config will cause it to be reset.
# 13
http://docs.sun.com/app/docs/doc/816-4554/6maoq020u?a=view
# 14
Hello.
Using DHCP you may really have problems changing the hostname.
The fact is: The DNS server may assign your machine a host name which has nothing to do with the host name you sent to the DHCP server. Depending on the server (typically DHCP and DNS server are the same machine) nothing will really work. (This is the case with my configuration where the servers are located on a DSL router.)
I solved the problem the following way:
* I created two host names (MyMachine and MyMachineNet) in the /etc/hosts file (Solaris 10 and newer: /etc/inet/ipnodes must be changed, too.)
* "MyMachine" is 127.0.0.1 (localhost):
127.0.0.1 localhost MyMachine
192.168.178.100 MyMachineNet
* I assigned the name "MyMachineNet" to the network interface in /etc/hostname.networkcard.
* I use DHCP
The computer name (in /etc/nodename) is "MyMachine". Some programs (e.g. Gnome !) establish a TCP/IP connection to "MyMachine" instead of "localhost" (I do not understand why). These programs are now satisfied because the host name "MyMachine" represents 127.0.0.1 (localhost).
I know that there is a switch that tells Solaris to take the machine name from DHCP/DNS instead of /etc/nodename. Unfortunately I forgot where it is.
Martin
# 15
Thank you.
DHCP is not critical in my system. The critical thing is a hostname.
My question: if I'll do sys-unconfig with no choosing dhcp, will system let me input a host name?
I use router as DHCP server (it accepts non DHCP clients too). On Windows systems, for example, I never had any problems with hostname (I'm migrating to UNIX).
# 16
Thank you all for replys.
You helped me very much.
I changed hostname using sys-unconfig. Now SMC works perfectly.
The only problem is access to Internet. My computer has network and ping to the router, but browser gives a message: "somesite.com could not be found. Please check name and try again."
# 17
Disconnect the server from the network prior to doing sys-unconfig, and you will be prompted for the hostname.
Don't ask me to explain why or how, but when sys-unconfig is used with the system connected to the network, the host name is automatically retrieved, and no opportunity to enter the hostname is presented.
Hope this helps.
# 18
I did all of these. None of them worked. Hostname still shows " unknown".
# 19
this is why i choose the windows server platfrom. its easy to configure.