LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 10-25-2005, 04:37 PM   #1
Scoobsky
LQ Newbie
 
Registered: Oct 2005
Posts: 11

Rep: Reputation: 0
Can't connect to host localhost


hi everyone,

FC2, ADSL Ethernet Modem Router, normal PIII PC.

I've got a problem trying to get any media player (StreamTuner, xmms, etc) trying to connect to any radio station.
I rebooted on my XP partition to test it and it works just fine from Winamp.

what makes me think it's a networking problem is that I also happen bo be hosting my own radio station here on my FC2 box, but when I try and connect to 127.0.0.1:8000 to listen to people who are connected to me and streaming, I get:
<10/25/05@22:19:37> [dest: 127.0.0.1] Invalid resource request(127.0.0.1:8000/)
that's what I get in the log of the ShoutCast Server.
As far as xmms is concerned, I just get an error msg saying:
"Couldn;t connect to host Localhost
Server reported: 404 Resource Not Found"

if I telnet into it, it says:
[root@localhost root]# telnet 127.0.0.1:8000
127.0.0.1:8000/telnet: Name or service not known

But I know the port it running cos people fromn the outside world can connect to that port on my Shoutcast server and listen to the tunes streaming from it.

I get the same problem even if I completely disable my internal firewall withsomething like GuardDog.

And I dont believe it's a problem at my ADSL Router level cos as I said it works just fine from windows/winamp.

Any ideas would be greatly appreciated! ;-)

Thanks in advance,
M.
 
Old 10-25-2005, 06:46 PM   #2
Quigi
Member
 
Registered: Mar 2003
Location: Cambridge, MA, USA
Distribution: Ubuntu (Dapper and Heron)
Posts: 377

Rep: Reputation: 31
Re: Can't connect to host localhost

Quote:
Originally posted by Scoobsky
if I telnet into it, it says:
[root@localhost root]# telnet 127.0.0.1:8000
127.0.0.1:8000/telnet: Name or service not known

But I know the port it running cos people fromn the outside world can connect to that port on my Shoutcast server and listen to the tunes streaming from it.
You have to give two arguments to telnet, i.e.,
Code:
telnet 127.0.0.1 8000
By the way, it's not necessary to do this as root, so I wouldn't -- no difference here, just a general rule of caution.

Maybe your server is only listening on the external interface, where your listeners connect, and not on the loopback (localhost, aka 127.0.0.1). To check that out, see what's listening on port 8000:
Code:
/usr/sbin/lsof -i :8000
(This has to be done as root.) You should get a line saying, in the NAME column,
*:8000 (LISTEN)
or
interface:8000 (LISTEN)
If you get an asterisk, it's listening on all available interfaces. In the latter case, which I suspect, only on the specified interface.

Anyway, why not refer to your station as your listeners do, i.e., by its hostname instead of "localhost"?
 
Old 10-25-2005, 07:36 PM   #3
Scoobsky
LQ Newbie
 
Registered: Oct 2005
Posts: 11

Original Poster
Rep: Reputation: 0
Thanks a lot for this.

I did as you suggested the lsof command and it returned this:
[root@localhost root]# lsof -i :8000
COMMAND PID USER FD TYPE DEVICE SIZE NODE NAME
sc_serv 3495 root 5u IPv4 6190 TCP *:8000 (LISTEN)

so as you suggested it's listening on all devices... which I suspect is a good thing right?

The telnet thing work.. thanks for that :-)

as for connecting to localhost vs hostname, I tired that too.. and I get the same problem... and it's not just trying to connect to my own station but I get the same thing trying to connect to any station out there on the Net.
I can play MP3s fine, either from xmms or streamtuner... so I dont believe it's an xmms config issue... the fact that it can't connect to *any* station at all... and the fact that it works just fine under windows/winamp, makes me think it's an internal linux networking issue.. but again.. I could be wrong...

could you or anyone else suggest something else to try or check?

Thanks again for your response.
M.

Last edited by Scoobsky; 10-25-2005 at 07:38 PM.
 
Old 10-26-2005, 11:47 AM   #4
Quigi
Member
 
Registered: Mar 2003
Location: Cambridge, MA, USA
Distribution: Ubuntu (Dapper and Heron)
Posts: 377

Rep: Reputation: 31
Yes, the output from lsof looks fine, your sc_serv is listening on all interfaces. So naming the station localhost:8000 shouldn't cause any problem.

Sorry, I don't know xmms at all. You might strace it; that could tell you what it's doing (in terms of system calls). But it probably won't give much of a hint about how to make it work.
 
  


Reply



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
localhost error /etc/host.conf Burian Fedora 2 02-21-2005 06:03 PM
Kmail - Could not connect to host localhost mike8994 Linux - Newbie 0 10-14-2004 07:56 PM
[apache2] could not connect to host localhost LordFrancis Linux - Networking 1 09-30-2004 02:37 PM
VSFTPD localhost-ok, remote host-cannot connect Giax Linux - Software 3 06-14-2004 06:27 AM
Konkueror - Could not connect to host localhost coffen Linux - Networking 0 01-20-2002 11:15 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 10:24 AM.

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
Open Source Consulting | Domain Registration