I'm having a bizarre problem. It started with postgresql-9.3 not installing. I found it couldn't find localhost
.
I checked /etc/hosts
and it has localhost
properly as 127.0.0.1
But when I
ping localhost
I get
PING localhost.Home (198.105.244.21) 56(84) bytes of data.
when I
whois 198.105.244.21
I get "SearchGuide Inc" in Colorado
How do I get my system to properly recognize localhost?
I'm running trusty tahr 14.04.2 lts
Here is my /etc/hosts
file:
127.0.0.1 localhost
127.0.0.1 ourcomp
# The following lines are desirable for IPv6 capable hosts
::1 localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
I had a typo earlier. It is now corrected.
Here is the output of nslookup localhost
:
nslookup localhost
Server: 127.0.1.1
Address: 127.0.1.1#53
Non-authoritative answer:
Name: localhost.Home
Address: 198.105.244.21
Name: localhost.Home
Address: 198.105.254.21
Output of iptables -L
:
Chain INPUT (policy ACCEPT)
target prot opt source destination
Chain FORWARD (policy ACCEPT)
target prot opt source destination
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
ufw
status is inactive
/etc/nsswitch
is blank
contents of /etc/resolv.conf
:
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
# DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 127.0.1.1
search Home
ifconfig
:
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:46904 errors:0 dropped:0 overruns:0 frame:0
TX packets:46904 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:2538766 (2.5 MB) TX bytes:2538766 (2.5 MB)
p5p1 Link encap:Ethernet HWaddr f0:4d:a2:9b:3b:b9
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
wlan0 Link encap:Ethernet HWaddr 00:1b:b1:81:06:3d
inet addr:192.168.0.14 Bcast:192.168.0.255 Mask:255.255.255.0
inet6 addr: fe80::21b:b1ff:fe81:63d/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:8968 errors:0 dropped:0 overruns:0 frame:0
TX packets:7779 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:4212369 (4.2 MB) TX bytes:1142565 (1.1 MB)
127.0.0.0
is the network address,localhost
should be127.0.0.1
(other IPs of this subnet is allowed although not prefarable)..could you please edit your question and add the output ofcat /etc/hosts
?iptables
orufw
or any other means of forwarding mechanisms configured ?localhost.Home
looks like an mDNS hostname: please add the contents of your/etc/nsswitch.conf
and/etc/resolv.conf
files, and output ofifconfig
echo 'hosts: files mdns4 mdns4_minimal [NOTFOUND=return] dns' | sudo tee -a /etc/nsswitch.conf
and then check..