Chinaunix

标题: 紧急求助:/usr/sbin/ping不同主机名 [打印本页]

作者: guandehe    时间: 2008-02-21 14:51
标题: 紧急求助:/usr/sbin/ping不同主机名
# cat /etc/hosts
# @(#)B.11.11_LRhosts $Revision: 1.9.214.1 $ $Date: 96/10/08 13:20:01 $
#
# The form for each entry is:
# <internet address>    <official hostname> <aliases>
#
# For example:
# 192.1.2.34    hpfcrm  loghost
#
# See the hosts(4) manual page for more information.
# Note: The entries cannot be preceded by a space.
#       The format described in this file is the correct format.
#       The original Berkeley manual page contains an error in
#       the format description.
#

192.168.10.242  sol9.vsc.com  sol9
192.168.50.49   batool
127.0.0.1       localhost       loopback

可见我的主机名为:batool,ip地址为:192.168.50.49
但是我ping主机名就是ping不通
# /usr/sbin/ping batool
/usr/sbin/ping: unknown host batool
如果我ping那个对应的ip地址倒是通了
# /usr/sbin/ping 192.168.50.49
PING 192.168.50.49: 64 byte packets
64 bytes from 192.168.50.49: icmp_seq=0. time=0. ms
64 bytes from 192.168.50.49: icmp_seq=1. time=0. ms

----192.168.50.49 PING Statistics----
2 packets transmitted, 2 packets received, 0% packet loss
round-trip (ms)  min/avg/max = 0/0/0

哪位大虾能告诉我为什么阿?该怎样ping通主机名,因为要用xmanager
作者: czyf2001    时间: 2008-02-21 17:28
nslookup
作者: 五“宅”一生    时间: 2008-02-22 12:05
修改hosts文件
作者: luweinet    时间: 2008-02-24 22:40
修改nsswitch.conf & reslov.conf可能解析顺序问题




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