1

/etc/hosts files usually have this line, ::1 localhost. I thought ::1 was the equivalent of 127.0.0.1/localhost, and from my reading it seems to be the IPv6 version. So I was using it in Apache for firewalling, "Allow from ::1" and it only allowed local. Then suddenly that stopped working, so I pinged ::1 and got a remote IP address. I tracerouted it and it went through my ISP, through some Microsoft server, then another half dozen steps of asterisks... I'm not sure why this would be (the remote IP), but it doesn't seem good. I grep'd my hard drive for the remote IP and it doesn't appear anywhere. Is this some indicator that I'm being hacked, or normal behavior? Maybe my IPv6 settings are wrong? (This is a brand new MacBookPro with Snow Leopard.) Any ideas about this would be great - what is ::1 supposed to be, why would it be remote, should I be worried, how do I get it back to localhost? Thank you!

2
  • 1
    Suspect this would be better asked in ServerFault.com May 6, 2010 at 2:14
  • 1
    What is the remote IP it is pointed to?
    – PK
    May 6, 2010 at 2:22

1 Answer 1

5

The problem is probably that ping doesn't handle IPv6, it's a tool from the good old IPv4 days. Since it doesn't recognize ::1 as a valid IPv4 address, it'll try to resolve it like a domain. For some reason, the DNS server you're using responds with a valid IPv4 address for this "domain".

To ping the IPv6 address, use ping6 ::1, which should yield answers from your localhost.
To trace where the DNS answer is coming from, try running dig ::1 +trace.

2
  • +1 for informative and concice answer.
    – Robert
    May 6, 2010 at 21:26
  • 1
    My bet is that if he replaced '::1' with 'dognostril', he'd get the same result. Likely a domain in his search path has a wildcard entry. Sep 7, 2011 at 17:45

You must log in to answer this question.