大网数据广告活动
服务器运维问答

Solaris 10 zone: ping does not resolve but nslookup does

· 52CE 我爱测

This question is very specific to Solaris 10 zones. I have a master zone and another zone. The master zone is working correctly with respect to DNS lookups: 'ping google.ca' works as does 'nslookup google.ca'. The file /etc/resol…

问题原文

原帖链接 · Huntrods · CC BY-SA 4.0

This question is very specific to Solaris 10 zones. I have a master zone and another zone. The master zone is working correctly with respect to DNS lookups: 'ping google.ca' works as does 'nslookup google.ca'. The file /etc/resolv.conf exists, has the correct DNS servers, and the default router is correct. ALL IS WORKING.

On the zone, 'ping google.ca' says "unknown host google.ca". However, 'nslookup google.ca' give the correct IP.

The zone has been setup correctly as far as I know - the default router is correct, netstat -nr shows what I expect to see including only one defaultrouter.

Zones don't normally have a /etc/resolv.conf file, but just to test I created one that's the same as in the root zone (and is correct). No change.

How do I set up the zone so that ping will work? (the inability to resolve domain names is causing other problems that I really need to fix).

The master zone has 'resolv.conf' and so I can ping named servers i.e. 'ping mydomain.com' from the server.

The second zone does not have resolv.conf, and I cannot ping

已采纳解答

原帖链接 · Huntrods · CC BY-SA 4.0

I reviewed some old system build notes, and found (and tested) the solution.

I did create the proper /etc/resolv.conf in the zone, but that wasn't enough. You also need to edit the default /etc/nsswitch.conf

the entry

hosts: files

needs to be changed to

hosts: files dns

saved, and then reboot the zone. Ping "domain name" now works.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2019-02-07)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。