TechNote: Problems With 'ping -s' in Solaris


There is an interesting 'feature' with the ping command in Solaris that may throw some people off when doing network troubleshooting. The -s flag, which does a continuous ping and prints each result does not work when the system's DNS servers are not available. Interestingly enough, ping without the -s flag will work and report the target is alive (assuming the target is alive). In order to get the -s flag to work, it is necessary to also use the -n flag, which tells the system not to do DNS lookups.

This may seem like an extremely obscure issue, however, if you are trying to troubleshoot why you can't do DNS lookups in the first place, finding that you can't ping may set you off down the wrong path with troubleshooting the issue. Hopefully this note will save people a little bit of time and frustration if they are ever in this situation.