Chinaunix

标题: 在SOLARIS下如何更改主机名 [打印本页]

作者: cqzhl    时间: 2002-01-24 12:41
标题: 在SOLARIS下如何更改主机名
在SOLARIS下如何更改主机名,和网络配置
作者: netstorm    时间: 2002-01-24 12:43
标题: 在SOLARIS下如何更改主机名
[这个贴子最后由netstorm在 2002/01/24 12:45pm 编辑]

主机名可以在这里改啊
/etc/hosts
/etc/hostname.
作者: zcycy    时间: 2002-01-24 13:06
标题: 在SOLARIS下如何更改主机名
也可以在adminitools里改
作者: jerryge    时间: 2002-01-24 13:17
提示: 作者被禁止或删除 内容自动屏蔽
作者: zcycy    时间: 2002-01-24 14:40
标题: 在SOLARIS下如何更改主机名
晕,你出什么主意呐?哈哈,笑的我肚子痛
作者: 飞狐    时间: 2002-01-24 15:05
标题: 在SOLARIS下如何更改主机名
你也可是这样改
vi /etc/nodename
就行了,不过好象只有在SOLARIS8中是这样的,别的我没试过。:)
作者: aini    时间: 2002-01-24 16:54
标题: 在SOLARIS下如何更改主机名
要改6个文件:hosts ,hostname.*(网络),nodename,/etc/net/下前2个文件,/etc/inet/hosts
作者: billson    时间: 2002-01-24 17:44
标题: 在SOLARIS下如何更改主机名
其实修改/etc/hosts和/etc/nodename两个文件即可,其它相应文件会自动更新的
作者: zhuchun    时间: 2002-01-24 22:32
标题: 在SOLARIS下如何更改主机名
1.boot -s
2.sys-unconfig
3.boot
你就可以定义你的主机名、ip地址,时区等等!
作者: bear    时间: 2002-01-25 00:45
标题: 在SOLARIS下如何更改主机名
zhuchun 你这招太过了!!!
sys-unconfig 清空的文件太多!!!
作者: zcycy    时间: 2002-01-25 09:39
标题: 在SOLARIS下如何更改主机名
呵呵,过犹不及;不过有时对付气人的猪脑(人家叫电脑,我觉得叫猪脑也不错),就是要下手狠点,越惯它它脾气越大;比如我的系统有病毒了,我肯定是重做系统,过三个月左右,就算系统还很稳定,我也要折腾它一下,所以我的计算机很老实,不敢和我较劲,嘿嘿
作者: sdwen    时间: 2002-01-25 16:40
标题: 在SOLARIS下如何更改主机名
修改:/etc/hosts
      /etc/nodename
      /etc/hostname.hme0
作者: huangsan    时间: 2002-01-26 19:14
标题: 在SOLARIS下如何更改主机名
/etc/hostname.hme0:主机名,hme0为网卡接口名
/etc/hosts:IP配置
/etc/defaultrouter:缺省网关
/etc/netmasks:子网掩码
/etc/nsswitch.conf:在host的行末加上dns,要与files用分隔符隔开
/etc/resolv.conf:配置域名服务器
/etc/nodename:也填上主机名
作者: jerryge    时间: 2002-01-26 23:17
提示: 作者被禁止或删除 内容自动屏蔽
作者: ohwwj    时间: 2002-01-28 09:36
标题: 在SOLARIS下如何更改主机名
我看最好把楼上说的六个文件都改了,要不然有问题哦
谁说可以自动改的 ???
作者: daemonix    时间: 2002-01-29 14:05
提示: 作者被禁止或删除 内容自动屏蔽
作者: ultra-guest    时间: 2002-01-30 09:35
标题: 在SOLARIS下如何更改主机名
我用hostname ***改。
然后重起。

作者: dishanqian    时间: 2002-01-30 10:57
标题: 在SOLARIS下如何更改主机名
楼上的,这样不行。
作者: ultra-guest    时间: 2002-01-30 11:46
标题: 在SOLARIS下如何更改主机名
那要怎么该呢?
有没有最好的公认的改法?是甚么?
作者: dishanqian    时间: 2002-01-30 13:36
标题: 在SOLARIS下如何更改主机名
其实试一下就可以了。

我只修改/etc/nodename一个文件,执行hostname,就可以看到修改了 。
作者: carlyang    时间: 2002-01-30 16:03
标题: 在SOLARIS下如何更改主机名
看你们讨论了这么久 , 除了用hostname yourhostname 以外,
用 uname -S yourhostname 是不是也很方便?


作者: 沐风    时间: 2002-01-31 23:10
标题: 在SOLARIS下如何更改主机名
使用命令sys-unconfig一次搞定。
作者: czc9    时间: 2002-04-09 16:44
标题: 在SOLARIS下如何更改主机名
我试过了,还是要修改6个文件,sa288里有说
/etc/hosts
/etc/hostname.hme0
/etc/nodename
/etc/net/ticots/hosts
/etc/net/ticotsord/hosts
/etc/net/tilts/hosts
作者: rimrock    时间: 2002-09-18 17:15
标题: 在SOLARIS下如何更改主机名
use this command:
uname -S newname
reboot

作者: 芾芾麐麐誩誩    时间: 2004-03-05 11:22
标题: 在SOLARIS下如何更改主机名
看了还是晕,不知以下想法是否正确:
系统名是存在/etc/hosts文件里的,里面本机IP可以对应好多名字,
机器名是存在/etc/nodename里的,只能有一条,
hostname.hm0里的是这网卡对应的系统名,必须出现在/etc/hosts文件里,
hostname 以及 uname -S hostname 只是修改了nodename文件,也就是只是修改机器名。
作者: kid52    时间: 2006-02-16 15:05
修改/etc/nodename 及 /etc/hosts & /etc/hostname.hm0 这三个文件就可以了

用sys-unconfig太狠了,所有以前的服务配置会全被删掉
作者: beyondsea    时间: 2006-02-17 10:17
更改主机名需修改六个文件
/etc/hosts
/etc/hostname.hme0
/etc/nodename
/etc/net/ticlts/hosts
/etc/net/ticots/hosts
/etc/net/ticotsord/hosts
作者: whoiam    时间: 2006-02-17 14:18
修改主机名和IP地址
1./etc/hostname.hme0 (主机名)
example:
sun5
2./etc/hosts (主机名/IP地址)   
example:
sun5        192.168.0.5
3./etc/netmasks (IP地址)
example:
192.168.0.0        255.255.255.0
4./etc/nodename (主机名)
example:
sun5
5./etc/net/ticlts/hosts (主机名,要写2遍)
example:
sun5        sun5
6./etc/net/ticots/hosts (主机名,要写2遍)
example:
sun5        sun5
7./etc/net/ticotsord/hosts (主机名,要写2遍)
example:
sun5        sun5
8./etc/defaultrouter (默认网关)
example:
192.168.0.1
作者: netant    时间: 2006-02-17 17:31
我向来都只修改/etc/nodename 及 /etc/hosts & /etc/hostname.<NIC Name> 这三个文件就可以了
难道有新改法?
作者: doni    时间: 2006-02-17 18:02
原帖由 bear 于 2002-1-25 00:45 发表
zhuchun 你这招太过了!!!
sys-unconfig 清空的文件太多!!!



9494,以前有一次,我做了sys-unconfig后,到处找hosts的备份
作者: deepsoul    时间: 2006-03-30 11:11
sys-unconfig 是在X86上的
hostname 肯定改不过来的
admintools 里也是改不过来的
作者: rikerzhang    时间: 2006-12-08 09:25
更改/etc/nodename后,运行hostname后 主机名就更改了。
为了使系统正常运行还需要改 /etc/hostname.***和 /etc/hosts

我看了下/etc/net/ticlts/hosts和/etc/net/ticotsord/hosts, 显示仍然为原来的hostname,需要手动改吗?  这两个文件有什么用?
作者: eddieyf    时间: 2006-12-08 13:41
顶一下.
作者: 苍之狼    时间: 2006-12-08 13:55
俺做的是Solaris9的系统,改变主机名涉及的文件有:
(1) /etc/hosts (change to the new hostname)
(2) /etc/nodename (change to the new hostname)
(3) /etc/hostname. (where is the name of the primary
interface for this system, i.e hostname.hme0 or hostname.le0.
Change to the new hostname.)
(4) /etc/net/ticlts/hosts (change both columns to the new hostname)
(5) /etc/net/ticots/hosts (change both coluums to the new hostname)
(6) /etc/net/ticotsord/hosts (change both columns to the new hostname)
改完上述文件之后推荐重起一下机器。——俺实际操作过的!
    系统部署情况不一样,所以有的修改了第(2)项就好了,但是我试过只修改第(2)项出现重启起不来的情况,据说好像是因为机器是多网卡配置,只修改了第(2)项是不行的,机器不能正常识别。第(1)(2)(3)都修改后就正常了。但是俺推荐大家(1)——(6)都做一下,毕竟这个是比较标准的操作。——俺胆子小,做事力求谨慎。
     至于第(4)(5)(6)是做什么用的,俺也不懂,俺也是个菜鸟。看这个帖子这么热,还希望能有大侠给详细解释一下。还有zhuchun的办法,最好新手不要轻易试。再有类似的情况,请不要这么教新手,会出人命的哦!!
作者: YuLimin    时间: 2006-12-25 16:02
如果是DHCP来获取IP的话,主机名如何修改?
作者: edxi    时间: 2010-06-01 20:58
顶出一古老的帖子

想知道修改好这些文件是不是只有重启机器才能有效呢?
作者: wstar    时间: 2010-06-02 10:05
改完不重启也行。
但是需要执行hostname 主机名手工更改一下,才能这次就立即生效。




欢迎光临 Chinaunix (http://bbs.chinaunix.net/) Powered by Discuz! X3.2