How can I detect which setting in the OS X could block ping localhost? IPFW, LittleSnitch no such rules?

Update 1:

> cat /etc/hosts   localhost   broadcast
  • Are you asking hypothetically what could block a ping or are you saying you are having this problem and need to know how to fix it?
    – tubedogg
    Aug 25, 2013 at 19:44
  • I have this problem. I have localhost over IPv6, but I need to have it over IPv4 (i.e.
    – static
    Aug 25, 2013 at 19:46
  • 1
    Can you please add the content of your /etc/hosts file?
    – nohillside
    Aug 25, 2013 at 20:12

3 Answers 3


The obvious choice would be if stealth mode were on. That blocks pings to localhost on all my Mac OS systems. Go to System Preferences, Security & Privacy, Firewall, Firewall Options...

Firewall options

Also, if you have "Block all incoming connections" that might also affect things. I would certainly turn off LittleSnitch since it also can and will block that sort of traffic if you haven't allowed it.

  • 1
    "Enable stealth mode" was clicked on mine. I assume that either some update clicked it for me or the behavior changed with regard to local ping (seems local ping should always be allowed.)
    – rfay
    May 27, 2020 at 20:18

Most likely it's your Mac OSX Firewall.

Go to System Preferences / Security & Privacy / Firewall and see if it's on. If it is, turn it off for a moment and see if you can ping localhost (please note, before you can turn the Firewall off, you'll need to click on the padlock in the bottom left corner and authenticate).

Don't leave your Firewall off though, unless you're absolutely sure that your Mac is not exposed to any external traffic at all (i.e. it's really only safe to do that when you're in a completely isolated network). The procedure above is to verify that it is the Firewall and not something else that's blocking the ICMP traffic to localhost.

  • sounds logically. the problem is System Preferences get stuck if I go to Security & Privacy. Do you know something about this symptom?
    – static
    Aug 25, 2013 at 20:22
  • How do you mean "it gets stuck"? Does it display anything? do you get a spinning beach ball? What exactly does it do? You can also open Console.app and see if there's anything saved into the log while the System Preferences "gets stuck". One more idea is to open Activity Monitor and see what's happening there - does it become unresposive? can you sample the process and see if it tries to read a file or something?
    – mike
    Aug 25, 2013 at 20:25
  • 1
    I mean spinning beach ball and (Not Responding). In the Console.app: System Preferences: httpdEnabled is deprecated !!
    – static
    Aug 25, 2013 at 20:31
  • OK. Not sure about that, to be honest... You can try enabling and disabling the firewall in command line. Have a look at superuser.com/questions/472038/….
    – mike
    Aug 25, 2013 at 20:41
  • That would indicate you have file corruption somewhere. If you're lucky it's just the security preferences. But it could also be larger, general filesystem issues. Try renaming/removing com.apple.security.plist and then rebooting to see if that helps.
    – ktappe
    Apr 21, 2015 at 3:20

It could also be a problem with the text-encoding of the /etc/hosts file: https://superuser.com/questions/541961/mac-os-x-mountain-lion-cant-ping-telnet-localhost-point-to-a-wrong-public-ip

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .