免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 4451 | 回复: 5
打印 上一主题 下一主题

Fedora12修改计算机名的问题 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2010-04-10 19:21 |只看该作者 |倒序浏览
我按照网上的方法修改计算机名,可是到修改/etc/hosts时遇到了困难,请大家指教一下。
edit the file:/etc/hosts, change the ip address and your hostname

[root@kcn-110]#vi /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
#127.0.0.1      localhost.localdomain   localhost
192.168.0.110   kcn-110mw       kcn-110mw
以上是网上的教程,可是我是路由器上网的,
运行"ifconfig"时,
“eth0      Link encap:Ethernet  HWaddr 00:22:15:A4:F0:C0  

          inet addr:192.168.1.103  Bcast:192.168.1.255  Mask:255.255.255.0

          inet6 addr: fe80::222:15ff:fea4:f0c0/64 Scope:Link

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:55807 errors:0 dropped:0 overruns:0 frame:0
          TX packets:47001 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:60388101 (57.5 MiB)  TX bytes:7980283 (7.6 MiB)
          Interrupt:18
lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:10 errors:0 dropped:0 overruns:0 frame:0
          TX packets:10 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:580 (580.0 b)  TX bytes:580 (580.0 b)

virbr0    Link encap:Ethernet  HWaddr CA:24:EE:5A:93:07  
          inet addr:192.168.122.1  Bcast:192.168.122.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:30 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 b)  TX bytes:4630 (4.5 KiB)

哪个是我的IP地址呢?

另外
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
这是我的hosts文件,请问我该怎么修改文件呢?

论坛徽章:
0
2 [报告]
发表于 2010-04-10 19:32 |只看该作者
eth0那个192.168.1.103是你的ip地址


virbr0是虚拟系统的接口,lo是系统自己的




你要修改自己的计算机名字,在这个文件里:/etc/sysconfig/network

加上:HOSTNAME=你的计算机名字

论坛徽章:
0
3 [报告]
发表于 2010-04-10 20:15 |只看该作者
如楼上所说修改/etc/sysconfig/network,重启系统

如果你的ip地址不是固定的,就不要修改/etc/hosts文件了,保留127.0.0.1和::1两行就可以了

论坛徽章:
381
CU十二周年纪念徽章
日期:2014-01-04 22:46:58CU大牛徽章
日期:2013-03-13 15:32:35CU大牛徽章
日期:2013-03-13 15:38:15CU大牛徽章
日期:2013-03-13 15:38:52CU大牛徽章
日期:2013-03-14 14:08:55CU大牛徽章
日期:2013-04-17 11:17:19CU大牛徽章
日期:2013-04-17 11:17:32CU大牛徽章
日期:2013-04-17 11:17:37CU大牛徽章
日期:2013-04-17 11:17:42CU大牛徽章
日期:2013-04-17 11:17:47CU大牛徽章
日期:2013-04-17 11:17:52CU大牛徽章
日期:2013-04-17 11:17:56
4 [报告]
发表于 2010-04-10 20:45 |只看该作者
楼主用路由上网,地址不固定,把机器名写到127哪行里面吧

论坛徽章:
4
CU大牛徽章
日期:2013-03-13 15:29:07CU大牛徽章
日期:2013-03-13 15:29:49CU大牛徽章
日期:2013-03-13 15:30:192015年迎新春徽章
日期:2015-03-04 09:57:09
5 [报告]
发表于 2010-04-10 21:11 |只看该作者
#127.0.0.1      localhost.localdomain   localhost
注释符#号去掉。

论坛徽章:
0
6 [报告]
发表于 2010-05-02 11:25 |只看该作者
谢谢。我明白了!
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP