- 论坛徽章:
- 0
|
我按照网上的方法修改计算机名,可是到修改/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文件,请问我该怎么修改文件呢? |
|