LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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


Reply
  Search this Thread
Old 11-21-2010, 05:18 AM   #1
vbekker
Member
 
Registered: Aug 2010
Location: Brooklyn, NY
Distribution: CentOS
Posts: 38

Rep: Reputation: 0
"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
 
Old 11-21-2010, 05:36 AM   #2
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2390Reputation: 2390Reputation: 2390Reputation: 2390Reputation: 2390Reputation: 2390Reputation: 2390Reputation: 2390Reputation: 2390Reputation: 2390Reputation: 2390
Hi,

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.

Hope this helps.
 
Old 11-21-2010, 01:04 PM   #3
jefro
Moderator
 
Registered: Mar 2008
Posts: 17,200

Rep: Reputation: 2563Reputation: 2563Reputation: 2563Reputation: 2563Reputation: 2563Reputation: 2563Reputation: 2563Reputation: 2563Reputation: 2563Reputation: 2563Reputation: 2563
Does hosts file contain localhost 127.0.0.1

Is loopback adapter enabled?
 
Old 11-21-2010, 01:37 PM   #4
vbekker
Member
 
Registered: Aug 2010
Location: Brooklyn, NY
Distribution: CentOS
Posts: 38

Original Poster
Rep: Reputation: 0
Code:
[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 ~]#
 
Old 11-21-2010, 01:39 PM   #5
vbekker
Member
 
Registered: Aug 2010
Location: Brooklyn, NY
Distribution: CentOS
Posts: 38

Original Poster
Rep: Reputation: 0
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
 
Old 11-21-2010, 01:41 PM   #6
vbekker
Member
 
Registered: Aug 2010
Location: Brooklyn, NY
Distribution: CentOS
Posts: 38

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by druuna View Post
Hi,

I don't see an actual question in the above post....
Hi,
The question is why am i getting such strange results from ping? Perhaps there is simple misconfiguration somewhere?
 
Old 11-21-2010, 04:02 PM   #7
eSelix
Senior Member
 
Registered: Oct 2009
Location: Wroclaw, Poland
Distribution: Arch, Kubuntu
Posts: 1,254

Rep: Reputation: 315Reputation: 315Reputation: 315Reputation: 315
And what is result of:
Code:
host -v localhost
host -v dnjlskdjflksdjlfksjdlf
 
Old 11-21-2010, 04:10 PM   #8
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2390Reputation: 2390Reputation: 2390Reputation: 2390Reputation: 2390Reputation: 2390Reputation: 2390Reputation: 2390Reputation: 2390Reputation: 2390Reputation: 2390
Hi,

Can you also post the following:

- 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.
 
Old 11-21-2010, 09:05 PM   #9
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Debian, Mageia, and whatever VMs I happen to be playing with
Posts: 12,885
Blog Entries: 18

Rep: Reputation: 3347Reputation: 3347Reputation: 3347Reputation: 3347Reputation: 3347Reputation: 3347Reputation: 3347Reputation: 3347Reputation: 3347Reputation: 3347Reputation: 3347
Just for grins and giggles, I did a whois 208.68.143.55.

It appears to be a moving firm in Needham, Mass., USA:

Code:
NetRange:       208.68.136.0 - 208.68.143.255
CIDR:           208.68.136.0/21
OriginAS:       AS40066
NetName:        FAST-HOSTED-SERVICES
NetHandle:      NET-208-68-136-0-1
Parent:         NET-208-0-0-0-0
NetType:        Direct Assignment
NameServer:     DNSBOSEXT.FASTSEARCH.NET
NameServer:     DNSDENEXT.FASTSEARCH.NET
RegDate:        2006-06-28
Updated:        2008-04-11
Ref:            http://whois.arin.net/rest/net/NET-208-68-136-0-1

OrgName:        FAST Search & Transfer Inc
OrgId:          FST-20
Address:        117 Kendrick Street
City:           Needham
StateProv:      MA
PostalCode:     02494
Country:        US
RegDate:        2006-05-04
Updated:        2006-05-04
Ref:            http://whois.arin.net/rest/org/FST-20

OrgTechHandle: JHH10-ARIN
OrgTechName:   Hutchinson, James Henry
OrgTechPhone:  +1-781-433-8999 
OrgTechEmail:  james.hutchinson@microsoft.com
OrgTechRef:    http://whois.arin.net/rest/poc/JHH10-ARIN

RTechHandle: JHH10-ARIN
RTechName:   Hutchinson, James Henry
RTechPhone:  +1-781-433-8999 
RTechEmail:  james.hutchinson@microsoft.com
RTechRef:    http://whois.arin.net/rest/poc/JHH10-ARIN
 
Old 11-21-2010, 09:21 PM   #10
vbekker
Member
 
Registered: Aug 2010
Location: Brooklyn, NY
Distribution: CentOS
Posts: 38

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by eSelix View Post
And what is result of:
Code:
host -v localhost
host -v dnjlskdjflksdjlfksjdlf
Same output for both:
Code:
[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 ~]#
 
Old 11-21-2010, 09:23 PM   #11
vbekker
Member
 
Registered: Aug 2010
Location: Brooklyn, NY
Distribution: CentOS
Posts: 38

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by druuna View Post
Hi,

Can you also post the following:

- 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 ~]#
Code:
[root@localhost ~]# cat /etc/resolv.conf 

nameserver 192.168.1.1
search localdomain
[root@localhost ~]#
Code:
[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 ~]#
 
Old 11-21-2010, 09:30 PM   #12
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Debian, Mageia, and whatever VMs I happen to be playing with
Posts: 12,885
Blog Entries: 18

Rep: Reputation: 3347Reputation: 3347Reputation: 3347Reputation: 3347Reputation: 3347Reputation: 3347Reputation: 3347Reputation: 3347Reputation: 3347Reputation: 3347Reputation: 3347
It's been a couple of years since I played with CentOS, but this link leads me to think that you may want to take a look at this file:

/etc/sysconfig/networking/devices/ifcfg-ethx

I'm not sure, but the x in ethx may represent the connection (eth0, eth1, etc.)
 
Old 11-21-2010, 10:08 PM   #13
vbekker
Member
 
Registered: Aug 2010
Location: Brooklyn, NY
Distribution: CentOS
Posts: 38

Original Poster
Rep: Reputation: 0
Hi frankbell,
This file is used to set parameters for an interface, here is what i have in there:
Code:
# VMware VMXNET3 Ethernet Controller
DEVICE=eth0
BOOTPROTO=static
ONBOOT=yes
HWADDR=00:0c:29:30:49:0a
IPADDR=192.168.1.33
GATEWAY=192.168.1.1
NETMASK=255.255.255.0
 
Old 11-21-2010, 10:35 PM   #14
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Debian, Mageia, and whatever VMs I happen to be playing with
Posts: 12,885
Blog Entries: 18

Rep: Reputation: 3347Reputation: 3347Reputation: 3347Reputation: 3347Reputation: 3347Reputation: 3347Reputation: 3347Reputation: 3347Reputation: 3347Reputation: 3347Reputation: 3347
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):

Code:
127.0.0.1	localhost
127.0.1.1	[localdomain]	tuna
192.168.1.5     [localdomain]   tuna
The second line might be redundant, but I left it in there.

(The rest of my hosts file is a bunch of redirects for tracking cookings that I got from here to redirect them to 127.0.0.1.)

Last edited by frankbell; 11-21-2010 at 10:36 PM. Reason: grammar
 
Old 11-22-2010, 02:15 AM   #15
tommyttt
Member
 
Registered: Oct 2009
Location: Federal Way, WA
Distribution: openSUSE 11.4 x86_64, openSuSE 12.1, Fedora 15
Posts: 207

Rep: Reputation: 34
Quote:
[root@localhost ~]# cat /etc/resolv.conf

nameserver 192.168.1.1
search localdomain
[root@localhost ~]#
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.

Tom
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
ping with even number ttl always return "Time to live exceeded" yafrank Linux - Networking 4 02-12-2012 03:30 AM
difference between "localhost" and "127.0.0.1"?? MarkoSan Linux - Newbie 8 07-25-2010 08:16 PM
Trying webmin, getting "attempt to connect to 127.0.0.1:10000 (localhost) failed" jeffreybluml Linux - General 1 08-16-2007 12:16 PM
KDE/CUPS printer slow to start up; fixed with "127.0.0.1 localhost" in /etc/hosts KWTm LinuxQuestions.org Member Success Stories 0 03-05-2005 12:11 PM
"host" ok, but "ping" can't find ip address hardigunawan Linux - Networking 2 05-16-2002 06:41 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:21 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration