$ nslookup mybox.mydomain.com
One address is the correct one, the other is bogus. So, every other DNS lookup gives the good address, and every other gives the bad address. Thus, consistently connecting every other time, consistently failing every other time. If the DNS lookup had three results, where two were bogus, I'd expect one good connection followed by two failed connections, consistently.
Keeping this in mind will save much time versus trying in vain to find some way of digging deeper info out of an fsockopen() failure.