- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Curl not resolving hostnames
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-02-2010 12:41 PM
тАО03-02-2010 12:41 PM
Curl not resolving hostnames
ixCurl A.07.00-7.15.3 A Command Line Tool For Transfering Data
When running curl commands, getting the following error:
neo: curl --verbose http://devtpe.glscorp.com/priceletter.php?filename=24204.txt > 24204.pdf
* getaddrinfo(3) failed for devtpe.glscorp.com:80
* Couldn't resolve host 'devtpe.glscorp.com'
* Closing connection #0
However, when I run an nslookup on the hostname, it returns the IP correctly.
/etc/nisswitch.conf has:
passwd: compat
group: compat
hosts: files [NOTFOUND=continue UNAVIL=continue TRYAGAIN=continue] dns [N
OTFOUND=continue UNAVAIL=continue TRYAGAIN=continue] nis
/etc/resolv.conf has:
search files
domain synergy55.com
search synergy55.com glscorp.com c1.com glsc1.com
nameserver 172.16.20.2
nameserver 172.16.17.8
Any other thoughts on what I need to do or check? Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-02-2010 01:05 PM
тАО03-02-2010 01:05 PM
Re: Curl not resolving hostnames
curl does not resolve host names.
Your system does.
I would say one or both of your nameserver entries in /etc/resolv.conf are not resolving requests.
See if you can ping them.
See if nslookup works, try using nslookup interactively to get more realistic error messaging.
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-02-2010 01:20 PM
тАО03-02-2010 01:20 PM
Re: Curl not resolving hostnames
anything else you would like me to look at?
neo(root)#nslookup
Using /etc/hosts on: neo
> set swtrace
> set all
Set options:
swtrace querytype=A
#Lookups = 3
files [RCCC] dns [RCCC] nis [RRRR]
Default Name Server: neo.synergy55.com
Address: 172.16.20.2
Default NIS Server:
Default files Server: neo
> devtpe.glscorp.com
Using /etc/hosts on: neo
lookup source is FILES
Using /etc/hosts on: neo
looking up FILES
*** No address information is available for "devtpe.glscorp.com"
Switching to next source in the policy
lookup source is DNS
Name Server: neo.synergy55.com
Address: 172.16.20.2
Trying DNS
Name: devtpe.glscorp.com
Address: 172.16.20.149
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-02-2010 01:37 PM
тАО03-02-2010 01:37 PM
Re: Curl not resolving hostnames
files dns files
with the same result, nslookup works, curl fails.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-02-2010 01:48 PM
тАО03-02-2010 01:48 PM
Re: Curl not resolving hostnames
neo(root)#nsquery hosts devtpe.glscorp.com
Using "files [NOTFOUND=continue UNAVIL=continue TRYAGAIN=continue] dns [NOTFOUND
=continue UNAVAIL=continue TRYAGAIN=continue] nis" for the hosts policy.
Searching /etc/hosts for devtpe.glscorp.com
devtpe.glscorp.com was NOTFOUND
Switch configuration: Allows fallback
Searching dns for devtpe.glscorp.com
Hostname: devtpe.glscorp.com
Aliases:
Address: 172.16.20.149
Switch configuration: Terminates Search
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-02-2010 01:55 PM
тАО03-02-2010 01:55 PM
Re: Curl not resolving hostnames
ipnodes: files [NOTFOUND=continue UNAVAIL=continue TRYAGAIN=continue] dns
At least in HP-UX 11.23, the default for "ipnodes" is first DNS, then files. This occasionally leads to surprises, as many HP-UX standard commands (e.g. telnet) are IPv6-aware in 11.23.
NOTE: the filename is *NOT* /etc/nisswitch.conf but /etc/nsswitch.conf.
It's a Name Service Switch, not just a NIS switch.
MK
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-02-2010 02:02 PM
тАО03-02-2010 02:02 PM
Re: Curl not resolving hostnames
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-02-2010 02:25 PM
тАО03-02-2010 02:25 PM
Re: Curl not resolving hostnames
neo(root)#curl --version
curl 7.15.3 (hppa2.0w-hp-hpux11.11) libcurl/7.15.3 OpenSSL/0.9.7i zlib/1.2.3
Protocols: tftp ftp telnet dict ldap http file https ftps
Features: IPv6 Largefile NTLM SSL libz
Also, by IP address the curl command works, but would like to avoid that if I can.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-02-2010 02:42 PM
тАО03-02-2010 02:42 PM
Re: Curl not resolving hostnames
("./configure ; gmake") here:
dy # uname -a
HP-UX dy B.11.11 U 9000/785 2012616114 unlimited-user license
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: Largefile NTLM SSL libz
Mine fails with a different complaint:
dy # curl --verbose http://devtpe.glscorp.com/priceletter.php?filename=24204.txt
* Curl_ipv4_resolve_r failed for devtpe.glscorp.com
* Couldn't resolve host 'devtpe.glscorp.com'
* Closing connection #0
curl: (6) Couldn't resolve host 'devtpe.glscorp.com'
which suggests that name resolution may take
many forms in this stuff. (On my VMS system,
for example, the 7.19.7 message says
"gethostbyname(2) failed [...]".)
If you have a useful C compiler, I'd suggest
building the thing from the source. With any
luck, the "configure" script might be able to
select a working bit of the (local) run-time
library for this task. A newer version might
catch a bug fix, too.
> Features: IPv6 [...]
And, if you build it yourself, you get better
control over the exotic (and potentially
dangerous) options.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-02-2010 03:09 PM
тАО03-02-2010 03:09 PM
Re: Curl not resolving hostnames
curl --verbose -4 www.google.com and see what you get.
I know that there is a new version available, however I didnt wish to install with all of the dependancies if possible. I always like to understand why it isnt working to make sure im not missing anything...always somebody smarter than me out there.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-02-2010 04:01 PM
тАО03-02-2010 04:01 PM
Re: Curl not resolving hostnames
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-02-2010 08:45 PM
тАО03-02-2010 08:45 PM
Re: Curl not resolving hostnames
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.)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-02-2010 09:14 PM
тАО03-02-2010 09:14 PM
Re: Curl not resolving hostnames
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-03-2010 05:14 AM
тАО03-03-2010 05:14 AM