Operating System - HP-UX
1753428 Members
4840 Online
108793 Solutions
New Discussion юеВ

Re: Curl not resolving hostnames

 
Steven Schweda
Honored Contributor

Re: Curl not resolving hostnames

> try your curl command [...]

dy # curl --verbose -4 www.google.com
* About to connect() to www.google.com port 80 (#0)
* Trying 209.85.225.106... connected
* Connected to www.google.com (209.85.225.106) port 80 (#0)
> GET / HTTP/1.1
> User-Agent: curl/7.20.0 (hppa2.0w-hp-hpux11.11) libcurl/7.20.0 OpenSSL/0.9.7i
zlib/1.2.3 libssh2/1.2.2
> Host: www.google.com
> Accept: */*
>
< HTTP/1.1 200 OK
[...]


Works on the VMS system, too:

alp $ curl --verbose -4 www.google.com
* About to connect() to www.google.com port 80 (#0)
* Trying 209.85.225.147... connected
* Connected to www.google.com (209.85.225.147) port 80 (#0)
> GET / HTTP/1.1
> User-Agent: curl/7.19.7 (ALPHA-HP-VMS) libcurl/7.19.7 OpenSSL/0.9.8j
> Host: www.google.com
> Accept: */*
>
< HTTP/1.1 200 OK
[...]


Whether "-4" actually does anything when I
lack "Features: IPv6" is another question, of
course, but basic operation is basic
operation.
Steven Schweda
Honored Contributor

Re: Curl not resolving hostnames

Curiosity and excessive (or misused) free
time collide again...

dy # ./configure --enable-ipv6 --with-zlib
[...]

dy # curl --version
curl 7.20.0 (hppa2.0w-hp-hpux11.11) libcurl/7.20.0 OpenSSL/0.9.7i zlib/1.2.3 lib
ssh2/1.2.2
Protocols: dict file ftp ftps http https imap imaps ldap pop3 pop3s rtsp scp sft
p smtp smtps telnet tftp
Features: IPv6 Largefile NTLM SSL libz

dy # curl --verbose www.google.com
* About to connect() to www.google.com port 80 (#0)
* Trying 209.85.225.147... connected
* Connected to www.google.com (209.85.225.147) port 80 (#0)
> GET / HTTP/1.1
> User-Agent: curl/7.20.0 (hppa2.0w-hp-hpux11.11) libcurl/7.20.0 OpenSSL/0.9.7i
zlib/1.2.3 libssh2/1.2.2
> Host: www.google.com
> Accept: */*
>
< HTTP/1.1 200 OK
[...]

dy # curl --verbose www.google.cow
* getaddrinfo(3) failed for www.google.cow:80
* Couldn't resolve host 'www.google.cow'
* Closing connection #0
curl: (6) Couldn't resolve host 'www.google.cow'


With "-4":

dy # curl --verbose -4 www.google.com
* About to connect() to www.google.com port 80 (#0)
* Trying 209.85.225.106... connected
* Connected to www.google.com (209.85.225.106) port 80 (#0)
> GET / HTTP/1.1
> User-Agent: curl/7.20.0 (hppa2.0w-hp-hpux11.11) libcurl/7.20.0 OpenSSL/0.9.7i
zlib/1.2.3 libssh2/1.2.2
> Host: www.google.com
> Accept: */*
>
< HTTP/1.1 200 OK
[...]

dy # curl --verbose -4 www.google.cow
* getaddrinfo(3) failed for www.google.cow:80
* Couldn't resolve host 'www.google.cow'
* Closing connection #0
curl: (6) Couldn't resolve host 'www.google.cow'


> [...] I always like to understand why it
> isnt working [...]

An argument could be made that it might be
easier to debug if you build your own.

> HPUX 11.11

I might have patches which you lack, too. As
usual, many things are possible. (And
everything's complicated.) "swa" may be your
friend.

For the record:

dy # cat /etc/resolv.conf
domain antinode.info
nameserver 10.0.0.9

dy # cat /etc/nsswitch.conf
cat: Cannot open /etc/nsswitch.conf: No such file or directory

Apparently, I'm using the compiled-in
defaults.

> /etc/nisswitch.conf has:

I'll assume that that was a typo. (Yet
another case where copy+paste of an actual
command would be better than something
worse.)
Michael Steele_2
Honored Contributor

Re: Curl not resolving hostnames

Hi

You'll get this behavior with an ftp proxy server, which needs to be logged into first before you run your curl command.

Check with network admin.
Support Fatherhood - Stop Family Law
Nick Lewers
Advisor

Re: Curl not resolving hostnames

thanks, there is no proxy server involved. and yes, the nisswitch was a typo.