windows xp - Website is resolving to localhost?
2014-04
For some reason, the website funshion.com resolves to localhost
(127.0.0.1
) when I run it on tracert
. The website should, of course, go to the website, not to my computer.
Basically, Funshion is a program used to watch Asian television shows. I installed it a few years ago in Windows XP. It worked fine, up until a few days ago, when the app started returning errors. I couldn't figure out why it stopped working, and I still don't know. So, I uninstalled it. However, when I tried to reinstall it, the website wouldn't load. So I finally tried running tracert
on the URL, and then realized it leads to localhost
, for some reason.
I first checked the hosts
file but there was nothing there that could be causing the problem, and the file itself hadn't been edited in two years. Where else can I check to see why this particular URL resolves to localhost
?
In addition, if I use my iPod Touch and connect to the same WiFi network that this computer is connected to, I can visit the website just fine, so the problem is not the network; it's the computer.
As a side note, every once in a while, the website will load the text and CSS, just not the images. I'm guessing that these might be cached, though, although I'm not entirely sure as I've already cleared the cache a few times, even after all of these problems started to occur.
Here's the full tracert
output:
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.
C:\Documents and Settings\user>tracert funshion.com
Tracing route to funshion.com [127.0.0.1]
over a maximum of 30 hops:
1 <1 ms <1 ms <1 ms localhost [127.0.0.1]
Trace complete.
C:\Documents and Settings\user>
Okay so I ran ipconfig /displaydns
. Funsion was there (as seen in the following piece of code). For some reason, it keeps coming back even if I run ipconfig /flushdns
. I think it's re-added if I try visiting the Funshion website in Firefox, for some reason. How can I find out where this is coming from so I can remove it permanently? (And, as I said earlier, it's not the hosts
file; I DO have entries in that file and they do indeed appear in displaydns
, but they don't disappear for a second—they always appear in displaydns
).
www.funshion.com
----------------------------------------
Record Name . . . . . : www.funshion.com
Record Type . . . . . : 1
Time To Live . . . . : 19573
Data Length . . . . . : 4
Section . . . . . . . : Answer
A (Host) Record . . . : 127.0.0.1
Record Name . . . . . : ns2.ai-dns.com
Record Type . . . . . : 1
Time To Live . . . . : 19573
Data Length . . . . . : 4
Section . . . . . . . : Additional
A (Host) Record . . . : 173.224.216.142
Record Name . . . . . : ns4.ai-dns.com
Record Type . . . . . : 1
Time To Live . . . . : 19573
Data Length . . . . . : 4
Section . . . . . . . : Additional
A (Host) Record . . . : 173.224.216.142
Record Name . . . . . : ns1.ai-dns.com
Record Type . . . . . : 1
Time To Live . . . . : 19573
Data Length . . . . . : 4
Section . . . . . . . : Additional
A (Host) Record . . . : 116.255.158.133
Record Name . . . . . : ns3.ai-dns.com
Record Type . . . . . : 1
Time To Live . . . . : 19573
Data Length . . . . . : 4
Section . . . . . . . : Additional
A (Host) Record . . . : 180.186.11.138
Okay, so ultimately what I did was I changed the computer's DNS from the default ISP ones to Google's public DNS. That seems to have fixed it. I still don't exactly know why the DNS record for Funshion keeps adding itself, but now it seems to have stopped doing that after I changed DNS.
I have a server running OS X Server 10.5 and it can't resolve localhost to 127.0.0.1.
When I try ping this is what happens:
> ping localhost ping: cannot resolve localhost: Unknown host
SSH and web browsers get similar results (uknown host). If I try using 127.0.0.1 or the ip address assigned on the LAN all of the above work.
Here's the contents of my /etc/hosts file:
> cat /etc/hosts ## # Host Database # # localhost is used to configure the loopback interface # when the system is booting. Do not change this entry. ## 127.0.0.1 localhost 255.255.255.255 broadcasthost ::1 localhost fe80::1%lo0 localhost
I have no local DNS service running.
Does anyone have any idea why this might be happening or how I can fix it?
I had this same issue with Mountain Lion (10.8.2). I solved it by by disabling "Stealth Mode" in Security & Privacy -> Firewall -> Firewall Options.
This is probably not related to your original question, but there is another issue that can affect DNS lookups in Mac OS X Lion, specifically localhost
or any other entries you may have in /etc/hosts
.
Apparently the /etc/hosts
file no longer supports multiple domains per line in the file, so every record needs its own line:
127.0.0.1 localhost
127.0.0.1 some.site.local
127.0.0.1 some.site.dev
Found this via Justin Carmony's blog. He goes on to describe some other "interesting" behavior if you're using /etc/hosts
, so read up if you're still having issues.
I know it's a little late, but in my case, changing the line endings to UNIX, replacing tabs with spaces and saving the file as UTF-8 made it work on Mountain Lion (10.8.2)
Hope this work for someone else.
I have the same problem. I just set up a new mac laptop and it was working until I migrated from my old one. Now ping localhost cannot resolve. Must be some setting I've changes somewhere, but I don't know where...
I've discovered that "ping localhost." works. Appending a trailing dot is meant to bypass searching for the name "localhost" in other search domains. That's cool, but I still don't understand why the /etc/hosts entry isn't working...
edit: Solved.
bash-3.2# dscl . read /Hosts/localhost
AppleMetaNodeLocation: /Local/Default
RecordName: localhost
RecordType: dsRecTypeStandard:Hosts
bash-3.2# ping localhost
ping: cannot resolve localhost: Unknown host
bash-3.2# dscl . append /Hosts/localhost IPAddress 127.0.0.1
bash-3.2# dscl . read /Hosts/localhost
AppleMetaNodeLocation: /Local/Default
IPAddress: 127.0.0.1
RecordName: localhost
RecordType: dsRecTypeStandard:Hosts
bash-3.2# ping localhost
PING localhost (127.0.0.1): 56 data bytes
64 bytes from 127.0.0.1: icmp_seq=0 ttl=64 time=0.083 ms
64 bytes from 127.0.0.1: icmp_seq=1 ttl=64 time=0.140 ms
voila!
Somehow, the directory services record was out of sync with the /etc/hosts file. And when there is no IP address in the directory services configuration, trying to resolve the name then goes to mDNSResponder which asks DNS.
In the end it just started working again. I found some unorthodox (and unneccessary) DNS configuration on the server and changed that to what it should have been, and perhaps that solved the problem? I can't be sure though because I wasn't trying to resolve the localhost issue at the time and so I didn't test localhost before and after.
Encoding can be a problem, I edited /etc/hosts using Sublime Text which gets me into the problem reediting it using vi fixed the problem. make sure that cat
outputs the contents.
Remove your hosts file and see what happens then. Also reboot without connecting to any networks.