Why isn't my localhost resolved to 127.0.0.1
One of my application cannot work properly due to the localhost is unreachable. I tried to figure out what the problem is and I found out that the localhost is not 127.0.0.1.
The following is the output message when I run "dig localhost"
MarydeMacBook-Air:resolver feng$ ping localhost
PING localhost.local (202.102.110.203): 56 data bytes
Request timeout for icmp_seq 0
^C
--- localhost.local ping statistics ---
2 packets transmitted, 0 packets received, 100.0% packet loss
MarydeMacBook-Air:resolver feng$ dig localhost
; <<>> DiG 9.8.3-P1 <<>> localhost
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 53519
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0
;; QUESTION SECTION:
;localhost. IN A
;; ANSWER SECTION:
localhost. 35 IN A 202.102.110.203
;; Query time: 9 msec
;; SERVER: 192.168.0.1#53(192.168.0.1)
;; WHEN: Wed Jul 1 07:55:37 2015
;; MSG SIZE rcvd: 43
The localhost is resolved to a foreign IP, 202.102.110.203, and the DNS server is 192.168.0.1 which is my wifi switch address.
The output of command "nslookup localhost" confirmed that:
MarydeMacBook-Air:resolver feng$ nslookup localhost
Server: 192.168.0.1
Address: 192.168.0.1#53
Non-authoritative answer:
Name: localhost.local
Address: 202.102.110.203
Does anyone knows what's the matter and how to resolve this problem?
Many thanks!
MacBook Air, OS X Yosemite (10.10.4)