Website URL
Error Message
php_network_getaddresses: getaddrinfo for api.telegram.org failed: Name or service not known
Other Information
PHP cannot resolve api.telegram.org — Telegram webhook setup fails
php_network_getaddresses: getaddrinfo for api.telegram.org failed: Name or service not known
PHP cannot resolve api.telegram.org — Telegram webhook setup fails
Welcome to the InfinityFree community forum! Good to have you here.
Beep boop, I’m a bot! I dug through the forum to get you started. I sometimes get things wrong though, so do with this what you will until a human has a look.
Yes, this looks like a deliberate restriction. Access to the Telegram API is blocked on our free hosting, so api.telegram.org won’t resolve from PHP even though it opens fine in your browser. A staff answer in a very similar topic says the block is there because of abuse and spam.
That answer also says receiving webhooks and API requests from anywhere isn’t supported on our hosting. So a Telegram webhook pointing at your site wouldn’t work either, not just the outgoing call.
The same answer says iFastNet’s premium hosting doesn’t have these two restrictions. It recommends asking them first if you plan to move a project there.
The staff answer is in this topic:
I don’t have a supported workaround for you.
As the bot said the telegram API is blocked due to historic abuse.