cURL can't connect to host

Website: https://www.XYmuseum.com/

I’m trying to access my API located at XYuseum.com which is on a different server. However, I’m either getting a blank response or connection time out.

You cannot use api, this is web hosting, not api hosting, and 1176.bodis.com is the holding page, you need to creste subdomain or add dns records, or wait for the subdomain to propogate

Sorry for bad grammar, I was on mobile.

2 Likes

cURL is blocked on free hosting.

No, it is not blocked here. You still can get content of other sites using cUrl, but due to Security System, curl will either stick at Security page or will timeout.

4 Likes

I’m not hosting the API on here. I’m trying to connect to my API which is hosted on my own server to get data needed for my website.

I forgot to mention, if I use cURL to connect to my server via its IP address, it works. It just doesn’t work with the subdomain.

I already have mentioned the reason above.

If I understood correctly the security system prevents non-browser access to websites hosted on infinityfree. However, my subdomain points to my own server.

It also disables access on websites which don’t have same domain. the server is same, but domain is not (i.e api.example.com != example.com)

How come I can request other domains fine? E.g. google.com

They aren’t hosted on any of MOFH sites, which won’t affect them.

What is MOFH? And, is there any way I can connect to my server without using its IP address?

MOFH Is MyOwnFreeHost it is a reseller plan, for people to offer, they are who run and sponser InfinityFree

Interesting, your DNS settings seem to be OK from most of the world, but on free hosting servers, it points to Bodis instead.

If I had to guess, I would say that the free hosting servers recognize that XYmuseum.com is hosted with us, and that they check our DNS servers first to find the records. Since our DNS servers don’t have any records for api.XYmuseum.com, it returns the default record instead (which is the Bodis parking page).

From anywhere else, it’s clear that your domain is using Cloudflare nameservers, and Cloudflare’s nameservers have the right DNS records for XYmuseum.com.

I don’t know exactly why this happens, whether this is intentional or whether this can be fixed I don’t know. But I’m quite certain that this is a result of something within the free hosting system.

3 Likes

This sounds about right. Would it be possible for you to clear the cache and see if that fixes it?

Clearing DNS cache (If even stored, but i believe BIND9 auto-stores it) at network level is a big task, and most large DNS providers do cache, like Google DNS, so the best you can do is wait, and see what happens.

I can’t clear the resolver cache and DNS cache is not what’s causing the issue. DNS caching means you may see the old DNS records. In this case, it returns records which may have never existed.

My initial guess was quite accurate: the free hosting servers just don’t check the regular DNS servers for domain names they host themselves.

2 Likes

Maybe re-create (remove & re-add) that sub-domain can fix this issue.

I’ve checked the issue with iFastNet, and unfortunately, this issue won’t be fixed soon, because we do not formally support using third party nameservers.

So any domain hosted on our systems will be checked against our nameservers first. Only if the domain doesn’t exist in our nameservers will the regular nameservers be checked. Since XYmuseum.com is hosed by us, our servers assume that XYmuseum.com should also exist on our nameservers.

So basically, you have these options:

  • Setup the API on a different domain which is not hosted with us.
  • Setup a CNAME record through our panel which also points to the API target.

These are the only options I can think of. There is no simple clear cache or turning things off and on again type of fixes here, because effectively our DNS system is working as intended by the developers, even if that’s not as expected by you.

3 Likes

It seems to be working now, the server is retrieving the correct IP for the subdomain.