Issue
When using Twilio to receive incoming SMS or MMS messages, you may configure a webhook URL where Twilio will send HTTP requests containing message data. Occasionally, you might encounter errors such as:
- HTTP bad host name
- The DNS entry for the URL’s host cannot be resolved
- Error 11210
These errors indicate that Twilio is unable to reach the webhook URL you have provided. This article explains what these errors mean, why they occur, and how you can resolve them.
Product
REST API and TwiML
Environment
legacy Twilio Console
Cause
When Twilio receives an incoming message for your phone number, it attempts to make an HTTP request to the webhook URL you’ve configured. If Twilio cannot resolve the hostname in your URL to a valid, public IP address, you’ll see errors like “HTTP bad host name” or “DNS entry for the URL’s host cannot be resolved.”
Common causes include:
- The hostname is misspelled or incorrect.
- The DNS record for the hostname does not exist or is not publicly accessible.
- The URL references an internal or private network (e.g.,
internal.example.comorlocalhost), which Twilio cannot access from the public internet. - The DNS record has not yet propagated.
Resolution
Follow these steps to resolve the issue:
-
Verify the Webhook URL
- Double-check the URL you have configured for incoming messages in the Twilio Console.
- Make sure there are no typos in the hostname.
-
Check DNS Records
- Use a public DNS lookup tool (such as Google Dig) to confirm that your hostname resolves to a public IP address.
- If the DNS record is missing or incorrect, update your DNS provider’s settings.
-
Ensure Public Accessibility
- The webhook URL must be accessible from the public internet. Twilio cannot reach URLs that are only available on private networks, VPNs, or behind firewalls.
- Avoid using hostnames like
localhost,127.0.0.1, or any internal-only domains.
-
Wait for DNS Propagation
- If you recently updated your DNS records, it may take some time for changes to propagate globally. This can take up to 48 hours in some cases.
-
Test with a Public Endpoint
- As a troubleshooting step, try setting your webhook to a known public endpoint (such as a request bin or a simple public server) to confirm that Twilio can reach it.
Example Scenario
Configured a webhook URL as https://example.com/reply. When Twilio attempted to send incoming message data, it returned the error “HTTP bad host name.” Investigation revealed that the hostname was not publicly accessible, resulting in DNS resolution failure.
Resolution
Update the DNS records and ensure the webhook server was accessible from the public internet. Once the DNS was properly configured and the server was reachable, Twilio was able to deliver incoming message requests successfully.class="notification"
Additional Information
- Configuring Webhooks for Incoming SMS
- Twilio Error Code 11210 Documentation
- Testing Webhooks with RequestBin
If you continue to experience issues after following these steps, review your DNS and server configuration, or consult your network administrator to ensure public accessibility.