Telegram error 400: Bad Request: bad webhook: IPv6-only addresses are not allowed
Last verified against Telegram Bot API reference
Bad Request: bad webhook: IPv6-only addresses are not allowedWhat error 400 means
The webhook host resolved only to an IPv6 address, or you passed an IPv6 address as ip_address. The hosted Bot API delivers webhooks over IPv4 only. Telegram's webhook guide states the requirement in its short version: your server must support IPv4, and IPv6 is currently not supported for webhooks. The Bot API server enforces it during setWebhook verification and prefixes the reason with bad webhook:.
Hosts that are IPv6-native are the usual source: some VPS plans, container platforms and edge networks give you an AAAA record by default and an A record only on request. Everything works from your own dual-stack laptop, which hides the problem until Telegram tries to connect.
A self-hosted local Bot API server does not apply this restriction, but on the hosted API you need an IPv4 address that accepts connections on one of the allowed ports.
What it looks like
{"ok":false,"error_code":400,"description":"Bad Request: bad webhook: IPv6-only addresses are not allowed"}Why it happens
- The domain has an
AAAArecord but noArecord. ip_addresswas set to an IPv6 address.- The hosting plan does not include a public IPv4 address.
How to fix Telegram error 400
- 1Add an A record for the webhook hostname pointing at a public IPv4 address.
- 2Put an IPv4-capable reverse proxy or CDN in front of an IPv6-only origin.
- 3Remove an IPv6
ip_addressvalue from the setWebhook call. - 4Re-register and confirm with
getWebhookInfo.
How to stop it recurring
Check that the webhook hostname has an A record as part of infrastructure provisioning, not after deploy. If you move hosts or change CDN settings, re-test DNS for both record types and re-run setWebhook, since a host that silently dropped its IPv4 record will fail the next registration. Port and protocol requirements are collected under webhook limits.
Official reference: Telegram Bot API reference. See all Telegram error codes or the Telegram limits and quotas.
Related codes
- 400: Bad Request: bad webhook: IP address N is reservedBad Request: bad webhook: IP address 192.168.1.10 is reserved
- 400: Bad Request: bad webhook: failed to resolve hostBad Request: bad webhook: failed to resolve host: <detail varies>
- 400: Bad Request: bad webhook: Webhook can be set up only on ports 80, 88, 443 or 8443Bad Request: bad webhook: Webhook can be set up only on ports 80, 88, 443 or…
Error 400 - quick answers
What does Telegram error 400 mean?
The webhook host resolved only to an IPv6 address, or you passed an IPv6 address as ip_address . The hosted Bot API delivers webhooks over IPv4 only. Telegram's webhook guide states the requirement in its short version: your server must support IPv4, and IPv6 is currently not supported for webhooks. The Bot API server enforces it during setWebhook verification and prefixes the reason with bad webhook: .
How do I fix Telegram error 400?
1. Add an A record for the webhook hostname pointing at a public IPv4 address. 2. Put an IPv4-capable reverse proxy or CDN in front of an IPv6-only origin. 3. Remove an IPv6 ip_address value from the setWebhook call. 4. Re-register and confirm with getWebhookInfo .
Stop debugging Telegram by hand
Connect the channel through Conferbot: tokens, webhooks and retries are handled, failures show as readable status.