1820693 Members
2673 Online
109627 Solutions
New Discussion

setting proxy setting

 
mwagiru
Frequent Advisor

setting proxy setting

How do I get my HP-UX box get to the net?
1). I set the DNS server ip address in /etc/resolv.conf
I can ping the DNS server.
2).I ran,from the commandline
export http_proxy=”http://username:password@proxy.blah.com”
But i can't lynx www.google.com
why?
10 REPLIES 10

Re: setting proxy setting

Have you configured nsswitch.conf for DNS. If not, configure the same and let me know the result.

- Vivek
mwagiru
Frequent Advisor

Re: setting proxy setting

ls
nsswitch.compat nsswitch.hp_defaults nsswitch.nisplus
nsswitch.files nsswitch.nis


I can't find nsswitch.conf
Matti_Kurkela
Honored Contributor

Re: setting proxy setting

If /etc/nsswitch.conf does not exist, the system will use default settings.

The default settings are documented in /etc/nsswitch.hp_defaults. Changing this file will have no effect: it is provided as an example only.

Does "nslookup www.google.com" report the correct address(es) for Google?

If it does, there might be a firewall preventing you from accessing the proxy... or the proxy itself might be configured to not serve your HP-UX box.
MK
mwagiru
Frequent Advisor

Re: setting proxy setting

nslookup www.google.com
Name Server: svdt1ad01.xyz.net
Address: 172.29.200.99

Trying DNS
Trying NIS
looking up FILES
*** No address information is available for "www.google.com"
Ralph Grothe
Honored Contributor

Re: setting proxy setting

You should look for the global lynx.cfg configuration file, or edit one in any place that you would refer to when invoking lynx by the -cfg=/some/other/lynx.cfg option.
Where your global lynx.cfg file is supposed to reside depends on how your lynx was configured before make.
For instance with my lynx build on AIX it resides in /usr/local/lib/lynx.cfg, but yours may be somewhere else.
If you edit this file search for directives that contain the string proxy.
There is ample comment how these directives ought to be set.
If you had invoked lynx with -h (or some other invalid option), or had read lynx's manpage you would have come accross the option "-pauth=id:pw" which is how you should pass the proxy credentials.
Better yet however would be setting them in the cfg file.
lynx should acknowledge the same variables like wget or the Perl LWP suite (aka libwww).
So I think you could as well export the environment variables proxy_user and proxy_passwd.
As many proxies behave differently it could be likely that yours isn't considering the credentials in the URI as you provided them (although according to the URI RFC this is valid syntax).
Our proxy for instance, doesn't care for URI embedded credentials, but the passing of a proper Base64 hashed request header of type
"Proxy-Authorization: Basic ", which wget or lynx formats for you from the above mentioned directive or option values, works very well.
You could check this if you have a recent Perl installation by an lwp-request which you pass your proxy-url with -p, the proxy credentials with -C, and get the request HTTP header displayed (together with the response) by the -U option.
Madness, thy name is system administration
Matti_Kurkela
Honored Contributor

Re: setting proxy setting

So your HP-UX box does not have a DNS that could resolve the Google's IP directly.
Can it at least resolve the IP of the proxy server?

Try something like:
nslookup proxy.blah.com

What is the port number of the HTTP proxy? It is not always port 80, but may be something else, like 8080.

In that case, use:
export http_proxy="http://username:password@proxy.blah.com:8080"
MK
mwagiru
Frequent Advisor

Re: setting proxy setting

nslookup 172.31.160.18
Name Server: svdt1ad01.blah.net
Address: 172.29.200.99

Trying DNS
Name: svdt2proxy02.blah.net
Address: 172.31.160.18


Ralph Grothe
Honored Contributor

Re: setting proxy setting

Actually, only your proxy needs to be able to resolve an Internet address but not the NS authoritative for names in your LAN.
Your user agent only needs to be able to resolve your proxy's name to which it passes the Internet URI whose content you want to fetch.
If your proxy cannot resolve e.g. www.google.com I would ask the admin responsible for the proxy to check their DNS.
Madness, thy name is system administration
mwagiru
Frequent Advisor

Re: setting proxy setting

But my pc is behind a firewall and cant resolve names but can access the internet....
This HP-UX box is baffling me!!
In which file in hP-UX do u insert the export http_proxy, instead of typing on the commandline?
Ralph Grothe
Honored Contributor

Re: setting proxy setting

Your setup seems quite common.
I assume that the mentioned HP-UX box isn't acting as the WWW proxy for your shielded PCs.
You would export any proxy related environment variables that your user agent understands (be it wget, lynx, links, lwp-request or whatever) in the user's environment that is running these UAs, so in most cases a shell profile file like $HOME/.profile,
or set them in a wrapper script that starts the UA.
Madness, thy name is system administration