Closed Bug 85020 Opened 23 years ago Closed 23 years ago

Proxy: http proxy - "localhost." works, "localhost" does not

Categories

(Core :: Networking, defect)

x86
Linux
defect
Not set
normal

Tracking

()

VERIFIED DUPLICATE of bug 82566

People

(Reporter: f.fuder, Assigned: jpm)

Details

After the migration from netscape to mozilla, the mozilla uses the same proxy
configuratione as netscape. The proxy configuration is localhost port 8080 but
mozilla can't resolv the hostname "localhost" If I use the IP number 127.0.0.1
it still works. The same thing happens in the mail task.

I'am not shure that this is a bug but Nestscape works with localhost.
DNS resolution of localhost has not been consistent for linux users.

Can you check a couple things?

/etc/nsswitch.conf (for hostname resolution configuration)
/etc/resolv.conf (for DNS resolution configuration)
/etc/hosts (for localhost entry)
nslookup localhost (for DNS configuration)

The usual problem is that for some reason, localhost is not found in /etc/hosts,
then goes to dns as "localhost.localdomain" and is not found either...

Status: UNCONFIRMED → NEW
Ever confirmed: true
Localhost always works for me. You could try this little perl script.


#!/usr/bin/perl -w
use Socket;
$host = (shift || "localhost" );
$iaddr = gethostbyname($host);
print "$host: ", (defined $iaddr) ? inet_ntoa($iaddr) : $! , "\n";


Just run it without any arguments. If it fails to find localhost then
the system is mis-configured somehow. If it works, the mozilla is borken
somehow.
ok I try both of your comments and I think all the scripts work well:
first I run the perl script, the output is:
fuder@queen:~ > ./test_mozilla
localhost: 127.0.0.1

the result of:
fuder@queen:~ > nslookup localhost
Server:  www-proxy.E1.srv.t-online.de
Address:  212.185.249.212
 
Name:    localhost
Address:  127.0.0.1

I think this is ok.
Keywords: qawanted
-qawanted, I'm on this one.

Lets find out if localhost is hardcoded by something (gagan made comments about
pac code doing this).

Use "localhost.netscape.com". It should resolve to 127.0.0.1. If that doesn't
work, its a connection problem. If it does work, its a resolution problem.
Keywords: qawanted
Use "localhost.netscape.com" works. I used:
ftp localhost.netscape.com port 8080 and it works
http localhost.netscape.com port 8080 and it works

at last I test the Mailsystem outgoing server localhost.netscape.com

and it works well.
Return-Path: <f.fuder@ob.kamp.net>
Received: from localhost (localhost [127.0.0.1]) by queen.ifaz
(8.11.2/8.11.2/SuSE Linux 8.11.1-0.5) with ESMTP id f5C679h00791 for
<fuder@localhost>; Tue, 12 Jun 2001 08:07:09 +0200
Received: from mail.kamp.net [195.62.97.26] by localhost with POP3
(fetchmail-5.6.0) for fuder@localhost

User-Agent: Mozilla/5.0 (X11; U; Linux 2.4.4 i686; en-US; rv:0.9.1)
Gecko/20010607
 
one more test. you can try "localhost." (use the period). Probably does not help
the way we handle strings -> DNS resolution, but the test should not take a lot
of your time.

If you have a lot of time, try configuring your proxy to run on the local
ethernet interface IP, use "localhost", I have a feeling you will connect.

Neeti, can you find out if we have re-hardcoded localhost?
Assignee: neeti → jpm
pac 
ok I try it and you are right. If I put a dot after localhost it works! without
the dot it doesn't work.

I change the configuration from squid to:
http_port localhost:3128 localhost:8080
but this makes no effect. same thing with dot it works without it doesn't work.
Neeti, why would this be PAC releatd?
Summary: connection to squid via localhost → Proxy: http proxy - "localhost." works, "localhost" does not
f.fuder:

I meant, change your server so that it runs on the ip address on the ethernet 
card, rather than the loopback address.
You will probably find that for some reason, mozilla converts "localhost" to 
whatever "ifconfig eth0" says is your IP address.

RESOLVED DUPE:


*** This bug has been marked as a duplicate of 82566 ***
Status: NEW → RESOLVED
Closed: 23 years ago
Resolution: --- → DUPLICATE
I still don't know what happened here, so I'm going to try one last line of
analysis.

f.fuder: can you type:

netstat -a | grep LISTEN | grep <PORT>

Probably you would find that junkbuster ran only on 127.0.0.1:80 (not *:80).
(oops, was a bit vague...)

..junkbuster ran only on 127.0.0.1:<PORT>(not *:<PORT>).
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.