Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

/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!

share|improve this question

migrated from stackoverflow.com May 6 '10 at 6:04

This question came from our site for professional and enthusiast programmers.

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

1 Answer 1

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.

share|improve this answer
    
+1 for informative and concice answer. –  Robert May 6 '10 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. –  David Schwartz Sep 7 '11 at 17:45

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.