PHP curl "couldn't connect to host"

Hi guys! Happy to be part of this community. Seems like a great bunch of people here. :)

Disclaimer: I'm a bit rusty with Linux. Used to use Redhat about 10 years ago, but not much experience since then.

I'm running Ubuntu 9.04 64 bit on my Linode.

Typical LAMP install with UFW. I only have port 80 and 22 open.

I'm running a web service that runs every 5 minutes via a cron job and needs to connect to other sites using their APIs. I'm using PHP curl to do this.

I moved from Dreamhost shared hosting (don't laugh! ;)) and everything was working smoothly, but on Linode the curl attempted connections are failing with errors like:
* name lookup timed out

  • couldn't connect to host My first thought is that I must not have any DNS servers setup. But I checked and I'm using DHCP which seems to be getting 2 of Linode's DNS servers.

Here's the DHCP information from Linode Manager Network tab:

****Gateways: 74.207.243.1

Netmask: 255.255.255.0

DNS Servers: 74.207.241.5, 74.207.242.5****

Any ideas? This is very strange indeed. Are the Linode DNS servers faulty or not reliable?

5 Replies

We have resolved some issues with the primary resolver in Fremont, which may have caused these problems. They should be resolved now.

Interesting, because the primary was down, but the secondary was up…surprising that cURL didn't move on the secondary (it should have)…

Thanks Jed!

It seems better now :)

Yeah, that is strange that it wouldn't try the 2nd DNS…

Hello,

we are getting "name lookup timed out" in curl. Its Singapore location.

@cozyvision:

Hello,

we are getting "name lookup timed out" in curl. Its Singapore location.

This thread is about to have its 7th birthday. You should start a new thread, and give details about what you're trying to do.

@dwfreed:

@cozyvision:

Hello,

we are getting "name lookup timed out" in curl. Its Singapore location.

This thread is about to have its 7th birthday. You should start a new thread, and give details about what you're trying to do.

I wanted to let you know that I laughed, like "Woo - What a good joke" then saw that it was a thread opened in 2009. Man, I can't assume anything on the internet.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct