免费注册 查看新帖 |

Chinaunix

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

可以ping通IP但是无法解析hostname [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2009-07-02 09:59 |只看该作者 |倒序浏览
最近安装了Solaris 10 x86,发现网络方面的问题.通过nslookup可以找到主机和对应的IP,但是直接ping主机名就解析不了,ping IP是OK的,哪位大虾帮助小弟一下,跪谢!




Last login: Wed Jul  1 14:37:29 2009 from 10.182.114.187
Sun Microsystems Inc.   SunOS 5.10      Generic January 2005

bash-3.00# ping db10g
ping: unknown host db10g

bash-3.00# ping 10.182.112.73
10.182.112.73 is alive

-----------------------------------------------------以下是配置----------------------------------------------------

bash-3.00# cat /etc/resolv.conf
search cn.xxxxx.com
nameserver 10.182.122.37
nameserver 10.182.244.34
nameserver 146.56.237.50
bash-3.00# nslookup db10g
Server:         10.182.122.37
Address:        10.182.122.37#53

Name:   db10g.cn.xxxxx.com
Address: 10.182.112.73

bash-3.00# cat /etc/defaultdomain
cn.xxxxx.com

bash-3.00# cat /etc/hosts
#
# Internet host table
#
127.0.0.1       localhost      
10.182.112.64   aquarius        loghost
10.182.112.64   aquarius.cn.xxxxx.com

论坛徽章:
2
丑牛
日期:2014-06-11 13:55:04ChinaUnix元老
日期:2015-02-06 15:16:14
2 [报告]
发表于 2009-07-02 10:26 |只看该作者
/etc/nsswitch.conf

论坛徽章:
0
3 [报告]
发表于 2009-07-02 10:32 |只看该作者
bash-3.00# cat /etc/nsswitch.conf
#
# /etc/nsswitch.files:
#
# An example file that could be copied over to /etc/nsswitch.conf; it
# does not use any naming service.
#
# "hosts:" and "services:" in this file are used only if the
# /etc/netconfig file has a "-" for nametoaddr_libs of "inet" transports.

passwd:     files
group:      files
hosts:      files
ipnodes:    files
networks:   files
protocols:  files
rpc:        files
ethers:     files
netmasks:   files
bootparams: files
publickey:  files
# At present there isn't a 'files' backend for netgroup;  the system will
#   figure it out pretty quickly, and won't use netgroups at all.
netgroup:   files
automount:  files
aliases:    files
services:   files
printers:       user files

auth_attr:  files
prof_attr:  files
project:    files
bash-3.00#

论坛徽章:
2
丑牛
日期:2014-06-11 13:55:04ChinaUnix元老
日期:2015-02-06 15:16:14
4 [报告]
发表于 2009-07-02 10:34 |只看该作者

回复 #3 zg2000 的帖子

这行改一下
hosts: files
改成
hosts: files dns

论坛徽章:
221
15-16赛季CBA联赛之吉林
日期:2017-12-11 12:51:59黑曼巴
日期:2019-04-12 13:40:0515-16赛季CBA联赛之广东
日期:2019-04-23 10:41:1215-16赛季CBA联赛之辽宁
日期:2019-05-06 13:03:2815-16赛季CBA联赛之山西
日期:2019-05-09 10:56:5815-16赛季CBA联赛之青岛
日期:2019-05-17 13:57:0515-16赛季CBA联赛之新疆
日期:2019-06-10 13:39:0515-16赛季CBA联赛之天津
日期:2019-07-08 15:04:4519周年集字徽章-19
日期:2019-08-27 13:31:2619周年集字徽章-19
日期:2019-08-27 13:31:2619周年集字徽章-周
日期:2019-09-06 18:46:4715-16赛季CBA联赛之天津
日期:2019-02-27 11:24:07
5 [报告]
发表于 2009-07-02 10:43 |只看该作者
DNS解析没有生效

论坛徽章:
0
6 [报告]
发表于 2009-07-02 10:54 |只看该作者
thks,work.谢谢各位兄弟姐妹!!!

论坛徽章:
0
7 [报告]
发表于 2009-07-02 11:13 |只看该作者
直接在/etc/hosts上加一条不就OK了。
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP