The hosted Bot API endpoint api.telegram.org intermittently fails to establish TCP connections over IPv6. The issue was observed from both a residential client in the Netherlands and a Contabo VPS in Germany.
The IPv6 address 2001:67c:4e8:f004::9 intermittently times out (curl exit 28), and from one client some attempts are refused (exit 7). IPv4 connections to the same hostname succeed. IPv6 connections to Google and Cloudflare from the same clients generally succeed in the same test windows.
When an IPv6 connection succeeds, it is fast, taking approximately 15–25 ms.
CopyHosting-CTB-VPS1 also has independent IPv6 gateway failures where its gateway drops out of neighbor discovery, documented in ../Contabo/ipv6-gateway-ndp-incomplete.md. However, the Telegram failure rate was more than twice its control failure rate.
A TCP traceroute to port 443 taken during a Telegram failure, while the gateway was operational, reached 2001:67c:4e8:f004::9 in 21 ms through Telia and Cogent in Amsterdam. This indicates that the path was delivering packets, while the endpoint did not accept the connection.
Local workaround:Tools/Connectors/ipv6_first.py uses IPv6 first with a 2-second window per address, then falls back to IPv4.
Steps to reproduce
Use a Linux host with working IPv6 connectivity.
Run the following command to repeatedly test api.telegram.org over IPv6 alongside Google and Cloudflare:
for i in $(seq 1 40); do
line="$(date -u +%H:%M:%S)"
for h in api.telegram.org www.google.com one.one.one.one; do
curl -6 -s -o /dev/null -m 6 "https://$h/"; line="$line $h=$?"
done
echo "$line"; sleep 30
done