"ping localhost" return a valid IP address, well at least not 127.0.0.1
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
"ping localhost" return a valid IP address, well at least not 127.0.0.1
Hi,
I apologize in advance if this already came up on any other threads, i was not able to locate any similar ones.
When i ping localhost:
Code:
[root@confluence conf]# ping localhost
PING localhost.localdomain (208.68.143.55) 56(84) bytes of data.
64 bytes from 208.68.143.55: icmp_seq=1 ttl=113 time=78.6 ms
64 bytes from 208.68.143.55: icmp_seq=2 ttl=113 time=77.2 ms
64 bytes from 208.68.143.55: icmp_seq=3 ttl=113 time=76.7 ms
64 bytes from 208.68.143.55: icmp_seq=4 ttl=113 time=80.4 ms
64 bytes from 208.68.143.55: icmp_seq=5 ttl=113 time=76.9 ms
Also the output of route:
Code:
[root@confluence conf]# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.1.0 * 255.255.255.0 U 0 0 0 eth0
169.254.0.0 * 255.255.0.0 U 0 0 0 eth0
default DD-WRT 0.0.0.0 UG 0 0 0 eth0
[root@confluence conf]# ping DD-WRT
PING DD-WRT.localdomain (208.68.143.55) 56(84) bytes of data.
64 bytes from 208.68.143.55: icmp_seq=1 ttl=113 time=77.0 ms
64 bytes from 208.68.143.55: icmp_seq=2 ttl=113 time=80.7 ms
64 bytes from 208.68.143.55: icmp_seq=3 ttl=113 time=78.3 ms
I don't see an actual question in the above post....
I do see one thing that doesn't look correct: localhost / localhost.localdomain should point to 127.0.0.1 by convention and it should not point to an outside location (as in the posted output).
What does you /etc/hosts file look like? There should be an entry like this present: 127.0.0.1 localhost.localdomain localhost and both localhost and localhost.localdomain should only be mentioned once.
[root@localhost ~]# cat /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost.localdomain localhost
::1 localhost6.localdomain6 localhost6
[root@localhost ~]#
What's weird i can ping "dnjlskdjflksdjlfksjdlf" or some random string of characters and get a response like this:
Code:
[root@localhost ~]# ping kajsdlkaldklsakdsa
PING kajsdlkaldklsakdsa.localdomain (208.68.143.55) 56(84) bytes of data.
64 bytes from 208.68.143.55: icmp_seq=1 ttl=113 time=80.8 ms
64 bytes from 208.68.143.55: icmp_seq=2 ttl=113 time=80.1 ms
64 bytes from 208.68.143.55: icmp_seq=3 ttl=113 time=78.0 ms
- Content of /etc/resolv.conf
- Content of /etc/nsswitch.conf
- Output of route -n
Looks like all your request are send to the outside world by means of asking your modem/router. Maybe the asked output can shed some light on the problem.
[root@localhost ~]# host -v localhost
Trying "localhost.localdomain"
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 18786
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0
;; QUESTION SECTION:
;localhost.localdomain. IN A
;; ANSWER SECTION:
localhost.localdomain. 10 IN A 208.68.143.55
Received 76 bytes from 192.168.1.1#53 in 36 ms
Trying "localhost.localdomain"
Host localhost.localdomain not found: 3(NXDOMAIN)
Received 114 bytes from 192.168.1.1#53 in 11 ms
Trying "localhost.localdomain"
Host localhost.localdomain not found: 3(NXDOMAIN)
Received 114 bytes from 192.168.1.1#53 in 11 ms
[root@localhost ~]#
- Content of /etc/resolv.conf
- Content of /etc/nsswitch.conf
- Output of route -n
Looks like all your request are send to the outside world by means of asking your modem/router. Maybe the asked output can shed some light on the problem.
Code:
[root@localhost ~]# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth0
0.0.0.0 192.168.1.1 0.0.0.0 UG 0 0 0 eth0
[root@localhost ~]#
[root@localhost ~]# cat /etc/nsswitch.conf
#
# /etc/nsswitch.conf
#
# An example Name Service Switch config file. This file should be
# sorted with the most-used services at the beginning.
#
# The entry '[NOTFOUND=return]' means that the search for an
# entry should stop if the search in the previous entry turned
# up nothing. Note that if the search failed due to some other reason
# (like no NIS server responding) then the search continues with the
# next entry.
#
# Legal entries are:
#
# nisplus or nis+ Use NIS+ (NIS version 3)
# nis or yp Use NIS (NIS version 2), also called YP
# dns Use DNS (Domain Name Service)
# files Use the local files
# db Use the local database (.db) files
# compat Use NIS on compat mode
# hesiod Use Hesiod for user lookups
# [NOTFOUND=return] Stop searching if not found so far
#
# To use db, put the "db" in front of "files" for entries you want to be
# looked up first in the databases
#
# Example:
#passwd: db files nisplus nis
#shadow: db files nisplus nis
#group: db files nisplus nis
passwd: files
shadow: files
group: files
#hosts: db files nisplus nis dns
hosts: files dns
# Example - obey only what nisplus tells us...
#services: nisplus [NOTFOUND=return] files
#networks: nisplus [NOTFOUND=return] files
#protocols: nisplus [NOTFOUND=return] files
#rpc: nisplus [NOTFOUND=return] files
#ethers: nisplus [NOTFOUND=return] files
#netmasks: nisplus [NOTFOUND=return] files
bootparams: nisplus [NOTFOUND=return] files
ethers: files
netmasks: files
networks: files
protocols: files
rpc: files
services: files
netgroup: nisplus
publickey: nisplus
automount: files nisplus
aliases: files nisplus
[root@localhost ~]#
So I'm guessing the computer has a static ip address of 192.168.1.33?
How about the contents of the hosts file (it's normally /etc/hosts, but I can't speak for sure about CentOS)?
Here's the relevant lines from one of mine with a static ip address (with "localdomain" substituted for my actual local domain name--I name all my computers after sea creatures):
This indicates the DNS(nameserver) is on your gateway. Is that correct? Are you providing your own DNS? If not, the nameserver needs to point to your DNS provider.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.