Sponsored Content
Full Discussion: 127.0.0.1 vs 0.0.0.0
Special Forums IP Networking 127.0.0.1 vs 0.0.0.0 Post 302952291 by useretail on Monday 17th of August 2015 06:34:51 AM
Old 08-17-2015
Network 127.0.0.1 vs 0.0.0.0

Which one should I use in '/etc/hosts'?
Please explain in details.

Random quotes on the topic:
Quote:
When you use the 0.0.0.0 method it doesnt try connect anywhere. But if you use 127.0.0.1 it actually tries to connect to a service on your computer which makes it take longer and use up more resources. Also you might run a webserver that it ask for invalid requests. Therefore it is better to use 0.0.0.0 than 127.0.0.1 as you want to kill the connection not to loop it back to your computer
Quote:
Why is it better? 0.0.0.0 doesn't connect anywhere. 127.0.0.1 does. If I run a web server that has a virtual host with the same domain name, it would serve the request.
Quote:
What does that have to do with 0.0.0.0? 0.0.0.0 has NO meaning on Linux, FreeBSD, or Mac OS-X and causes problems on those operating systems. The added benefit of using 127.0.0.1 is that the top phttpd (Pseudo HTTP Daemon) and Homer log what is being stopped and why.
Quote:
I have tested both ways in Windows XP and Windows Server 2003 only, and all I can tell so far is that using a template in this form:
127.0.0.1 google-analytics.com
127.0.0.1 ssl.google-analytics.com
is not good at all for my system, and it can slow down even the most common operations.

But I have found that using a template in this form:
0.0.0.0 google-analytics.com
0.0.0.0 ssl.google-analytics.com
seems to be ok as far as system stability is concerned, and even the webpages are loading faster.
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Background processes return 127 sporadically

I have created a shell script that spawns multiple background processes (spawns sqlplus application). I use an array to capture the process id of those background processes. I then loop through the array and issue a 'wait' command to wait on the process id that was captured in the array. I am... (2 Replies)
Discussion started by: max_largo
2 Replies

2. UNIX for Advanced & Expert Users

Serverhost 127.0.0 error message on apache

my apache 2.0 is up and running but after trying to reconfigure it for specifics I ended up with a permanent eror message that I can't seem to get rid of .. when I run the server ( just / */apachect1 start ) the message reads "cannot locate name localhost for server 127.0.0" so far I have tried... (2 Replies)
Discussion started by: moxxx68
2 Replies

3. Shell Programming and Scripting

rc=127 can't fork

I have a script to download a file using wget. It works if I execute it from the command line. But, if I run it in cron, it doesnt work and I am getting the following in the cron log: > CMD: /export/home/username/test > username 23159 c Tue Aug 1 14:40:00 2006 < username 23159 c Tue Aug ... (1 Reply)
Discussion started by: BG_JrAdmin
1 Replies

4. Solaris

Can't setup gateway other than 127.0.0.1?

I have just installed Solaris 10 X86 today, but I can't use internet at all on it. When I was installing it, it only asked me to create a hostname, without even asking me this computer is "networked" or "non-networked". After I finished installation, I use "netstat -rn" command, and only see... (3 Replies)
Discussion started by: Diamondust
3 Replies

5. HP-UX

logrotate: ALERT exitted abnormally with [127]

HP-UX B.11.23 U 9000/800 636114222 unlimited-user license I see this error in my logs sometimes and have very little info on it... I have searched online for some documentation and haven't been able to find much on this issue. The only thing I found on one site is that if my /tmp folder... (4 Replies)
Discussion started by: zixzix01
4 Replies

6. Shell Programming and Scripting

Execution of shell script returns error 127

Hi All, While running shell script i got following output. interpreter "usr/bin/ksh" not found sh: step1.sh: not found. ldnhpux | oracle >echo $? 127 - Running command "which ksh" retruns "usr/bin/ksh". - I found some information on web stating to remove extra carriage return chars,... (8 Replies)
Discussion started by: RuchirP
8 Replies

7. Solaris

sendmail problem, Connection refused by [127.0.0.1]

one of our sparc servers is having this problem: Jun 27 13:05:00 sparki sendmail: p5: from=root, size=309, class=0, nrcpts=1, msgid=<201106271305.p5@sparki>, relay=root@localhost Jun 27 13:05:00 sparki sendmail: p5: to=root, ctladdr=root (0/0), delay=00:00:00, xdelay=00:00:00, mailer=relay,... (3 Replies)
Discussion started by: orange47
3 Replies

8. Solaris

multitude of packets from 127.0.0.1

I was checking routing table, and noticed that our server has a lot packets from localhost: Routing Table: IPv4 Destination Gateway Flags Ref Use Interface -------------------- -------------------- ----- ----- ------ --------- .. 127.0.0.1 127.0.0.1 ... (1 Reply)
Discussion started by: orange47
1 Replies

9. UNIX for Advanced & Expert Users

wait - return code 127

Hi All, I am trying to create background processes and then check their status later. But I am getting return codes as 0,127 randomly On checking the return codes for wait, I found the below. Do I need to treat return code of 127 as successful as well?? as we know the process id passed is... (7 Replies)
Discussion started by: tostay2003
7 Replies
desproxy(1)							   User Commands						       desproxy(1)

NAME
desproxy - a TCP tunnel for HTTP proxies SYNOPSIS
desproxy remote_host remote_port proxy_host proxy_port local_port OPTIONS
None. DESCRIPTION
HTTP proxies are network servers that are used to give HTTP (web) access to computers that are not connected to the Internet. This is a typical scenario in corporate networks and recently in home networks too. HTTP proxies connect to the Internet either directly or via a parent proxy (which in fact connects to the Internet directly or via another parent proxy, and so on...) HTTP clients (web browsers) use HTTP proxies to request web pages; the HTTP server just forwards those request to the destination server. All the negotiation is done via the HTTP protocol, which is designed just to carry HTTP requests and no generic (TCP/IP) traffic. That is why you can't (normally) use Internet applications beside your web server if you are behind a HTTP proxy. That is what desproxy is good for. Desproxy is a TCP tunnel, which means desproxy can forward TCP/IP traffic via a HTTP proxy. Desproxy uses a HTTP/1.1 method (CONNECT) to establish TCP/IP connections on demand. CONNECT is used for SSL connections when accessing to secure sites, so if you can access sites that support SSL (www.hotmail.com for example) you can use desproxy. Not all IP (Internet) traffic is just TCP/IP. In fact there are two more protocols widely used in the Internet not supported by desproxy: UDP and ICMP: o ICMP is used to manage large IP networks. The only application using ICMP you may miss is ping. o UDP is an unreliable connection-less fast transport protocol, mostly used in network games and other applications that need low latency network traffic. Notably DNS uses UDP packets for fast delivery. Will desproxy work with my HTTP proxy? Short answer: just give it a try Long answer: desproxy should work with every HTTP proxy, with the following exceptions: o MS Proxies with NTLM authentication. NTLM is a proprietary authentication method from Microsoft, not a standard authentication method. Maybe in the future desproxy will support NTLM authentication, but currently it doesn't. o HTTP/1.0 Proxies. Desproxy needs the CONNECT method, which is only available from HTTP/1.1 protocol version. It's very unlikely your proxy doesn't accept HTTP/1.1 requests. o HTTP/1.1 Proxies without the CONNECT method. Maybe your network administrator deactivated CONNECT support in the proxy, or maybe CONNECT is restricted to the HTTPS port (443). Assumptions Let's assume the following: o your HTTP proxy host name is "proxy" and its address is "192.0.0.1" o your HTTP proxy port is "8080" o your HTTP proxy doesn't need authentication. It case you need HTTP authentication, please read [2]this. o your system console will be a terminal (xterm, the console or a virtual terminal) if you are running Linux, *BSD or other UN*X About connections Imagine you need a network application that uses only one TCP/IP connection with just one server. That's the case of IRC in which you connect to an IRC server or ssh where you tipically connect just to one UNIX computer at a time. That's what I called a "static connection". Of course that's not the case of a web browser or a file sharing program, both of them doing several connections at a time to different computers. That's what I call "dynamic connections". STATIC CONNECTIONS EXAMPLES
item How to use desproxy to connect to IRC Suppose you want to connect to IRC using irc.undernet.org port 6667 as your IRC server. First you have to start a system console (see Assumptions above for details) and type desproxy irc.undernet.org 6667 proxy 8080 1080 That should start desproxy, giving you the copyright notice along with some information. The following is a screen capture from desproxy 0.0.23 ----------------------------------- desproxy 0.0.23 (c) Miguelanxo Otero Salgueiro 2001 This release brought to you patched by Rutger Nijlunsig. See RutgerWork.txt in documentation for details about new features. Great work guy! ----------------------------------- TCP port 1080 Binded & Listening Press ENTER to Quit Desproxy reports it is listening in local port 1080 ready for a connection. Open your favourite IRC client (install it first ;D) and connect to 127.0.0.1 port 1080 as your irc server (127.0.0.1 is a virtual IP, always referencing to your local machine). Then, your IRC client should connect to desproxy. It looks like Connection request from 127.0.0.1, port 1220 Connecting to http proxy (proxy:8080) Bidirectional connection established Then you should be able to use your IRC client as if you were directly connected to irc.undernet.org. How to use desproxy to log in a computer using ssh Suppose you have a shell account in a computer that supports secure connections via ssh. Let's assume it's called shell.corporate.com. SSH uses port number 22 by default. So start a new system console and type: desproxy shell.corporate.com 22 proxy 8080 1080 Then, tell your ssh client to connect to localhost (127.0.0.1) port 1080 and you should get a ssh password prompt! How to use desproxy to use other static clients Let's assume you want to use network application X, which doesn't support HTTP proxies but use one TCP/IP connection (like IRC and SSH). To make X work with desproxy, you just have to 1) Search for the default port of that application 2) Search for the default server of that application and 3) Start desproxy, passing that info as command line parameters. Format is desproxy remote_host remote_port proxy_host proxy_port local_port Just give a local_port of your desire, but always over 1023, cause lower ports may need administrator privileges. About HTTP Authentication Some HTTP proxies need for security reasons a method of checking client's identity. That's called HTTP authentication (or HTTP authorization). Despoxy now supports Basic HTTP authentication. If your proxy needs other kind of authentication (either Digest or NTLM) desproxy won't work. For desproxy to work with a HTTP proxy that needs authentication, you have to tell desproxy which username and password to use. Desproxy reads the environment variable PROXY_USER to get that info. Suppose your proxy username is "mayka" and your proxy password is "007sgotLTK". Then, before using any of the desproxy programs you should type this in your system console: set PROXY_USER=mayka:007sgotLTK Beware passwords can include some characters that should be escaped from the system console. For example, if your password is "moon!=sun", and you are running Linux, you should type export PROXY_USER=yourusername:moon!=sun Note characters "!" and "=" are escaped using the backslash "". If you are running MS Windows, as long as I know, you don't have to escape any valid password character. head1 Troubleshooting A normal desproxy session looks like this: $ desproxy 127.0.0.1 21 127.0.0.1 4480 2222 ----------------------------------- desproxy <version> HTTP/1.1 (c) Miguelanxo Otero Salgueiro 2001 ----------------------------------- Listening on port 2222 Connection request from 127.0.0.1, port 1227 Connecting to http proxy (127.0.0.1:4480) Bidirectional connection stablished (127.0.0.1:21) <-> (localhost) End of connection. Here, a connection to local ftp server (127.0.0.1:21) is made by using local proxy (127.0.0.1:4480). You can see how, after the connection is accepted, desproxy connected to the proxy, interchanged some bytes (a FTP session) and terminates the connection. Desproxy is quite self explanatory about errors. Desproxy-inetd is far more obscure, because the way inetd uses it (can't print error messages) to the console. Basically there are two kind of errors: o Errors reported when connecting to the proxy: the http page showing the error is displayed. o Every other error: a short error message is displayed. Some common HTTP errors (as reported by the proxy) * HTTP 400 Bad Request - Some versions of desproxy (0.0.21) cause this error (FATAL) * HTTP 403 Forbidden - Forbidden to do that (FATAL) * HTTP 404 Not Found - Page not found, or resource not found (MINOR) * HTTP 405 Method not Allowed - Can't do CONNECT method (FATAL) * HTTP 500 Internal Server Error - Maybe you're trying to connect to a remote closed port (remote site reported connection refused) (MINOR) * HTTP 503 Service Unavailable -> The proxy can't reach the site (MINOR) * HTTP 505 HTTP Version Not Supported - CONNECT method not available (FATAL) * HTTP 502 Bad Gateway - Stands for "DNS lookup error" (MINOR) (FATAL) - Forget about using desproxy, you can't surpass the proxy. (TODO) - To do, not yet implemented. (MINOR) - Temporary fault or maybe your fault. ENVIRONMENT
PROXY_USER An example: PROXY_USER=mayka:007sgotLTK Beware passwords can include some characters that should be escaped from the system console. For example, if your password is "moon!=sun", and you are running Linux, you should type PROXY_USER An example: PROXY_USER=yourusername:moon!=sun Note characters "!" and "=" are escaped using the backslash "". FILES
None. SEE ALSO
dnsproxy-dns(1), dnsproxy-inetd(1), dnsproxy-socksserver(1), connect(1) AUTHORS
This manual page was written by Jari Aalto <jari.aalto@cante.net>, for the Debian GNU system (but may be used by others). Released under license GPL v2 or, at your option, any later version. desproxy 2012-03-26 desproxy(1)
All times are GMT -4. The time now is 05:58 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy