saintpete / twilio-go

Twilio Go library
https://godoc.org/github.com/kevinburke/twilio-go
MIT License
52 stars 104 forks source link

Cache DNS records #3

Open kevinburke opened 8 years ago

kevinburke commented 8 years ago

Twilio has a short TTL on api.twilio.com. In the event of a DNS lookup failure, we should try the last known good IP addresses, as it's unlikely the service has changed IP's.

kevinburke commented 8 years ago

I could accomplish this by overriding DialContext but that would be doing a lot. Potentially I could do the DNS lookup and then always pass an IP address to the default DialContext.

Added a tracking ticket here for a different way: https://github.com/golang/go/issues/17554