< Fried Tofu
Shaun of the Dead >

[Comments] (3) : Hey, quick question. If I start up a server and bind it to localhost (instead of an IP address or an external hostname), then no one can access the server from outside localhost, right? This is backed up by my experience and stuff I've read, but I want to make triple sure so I don't tell people they're okay when they're actually exposing their systems to the outside.


Comments:

Posted by Josh at Sat Apr 09 2005 16:02

So long as you bind to 127.0.0.1, you should be fine, yes. So long as the idiot user hasn't changed the loopback address (which would be so amazingly broken =). I have seen people munge localhost to an external IP in their /etc/hosts, which is also broken, but happens. That's why I usually choose 127.0.0.1 (that, and I'm usually working at a lower level, so having an IP to stuff in is easier).

Posted by Josh at Sat Apr 09 2005 16:04

Oh, and! If you're doing a significant amount of network programming, I can't recommend a copy of Unix Network Programming: Volume 1 enough. Stevens is more canonical than POSIX.

Posted by Leonard at Sun Apr 10 2005 02:45

I had Volume 1 as a textbook for my networking class in college. It was indeed excellent. I don't think I need it at the moment, though. I seem to have made it through writing the "networking for beginners" chapter all right.


[Main]

Unless otherwise noted, all content licensed by Leonard Richardson
under a Creative Commons License.