Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Bind listening socket to domain name

Status
Not open for further replies.

Kirsle

Programmer
Jan 21, 2006
1,179
US
With a Linksys router, is it possible for a computer to open a listening socket (server) using a domain name as its host? For example:

Code:
$sock = IO::Socket::INET->new (
   LocalHost => 'chat.mysite.com',
   LocalPort => 6667,
);

Before I got my Linksys router, I could do this, assuming that the domain 'chat.mysite.com' had an A record pointing to my external IP address. But now, 'chat.mysite.com' would be pointing to my router's IP address, and this seems to complicate it.

I have my router set up to forward every port to one computer which is on 24/7 (the other computer is a laptop), so this one runs my servers. Currently it runs an Apache HTTP server which can accept connections, and it's set up to bind to 127.0.0.1:80, but when I bind my own server to 127.0.0.1:6667, it makes it only available to my local network.

Also, my server can't bind to my external IP address either, which I thought was a little odd, since it seemed to be a similar setup than binding to a domain name (since the domain could directly connect to my computer, but in this case the router would be directly connected to my computer).

The closest I could get was to bind it to 192.168.1.100:6667 (my internal IP address), and this made it accessible through chat.mysite.com on the local machine, but on my laptop, I couldn't connect to the server through chat.mysite.com

Does anyone know how to do this? I want it to bind to a domain name to guarantee its visibility to the outside world, so that a chat client can connect to chat.mysite.com:6667 instead of having to enter an IP address.

Thanks in advance.

-------------
Kirsle.net | Kirsle's Programs and Projects
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top