We’ve all heard of Russian roulette, the game where you take a 6-shooter, put 1 bullet in it, spin it, and point it at your head. I’m hoping this only exists in movies.

But what about DNS roulette? Here’s an example. I’m using a web service (Travis) as a CI. And like all good microservices things, there are multiple endpoints, all accessed by my browser. One of them is ‘api.travis-ci.org’. I’m finding the web page is a bit flakey, sometimes it works, sometimes not.

So lets dig in shall we? I try DNS lookup:

$ host api.travis-ci.org
api.travis-ci.org is an alias for nagano-4814.herokussl.com.
nagano-4814.herokussl.com is an alias for elb052915-208107455.us-east-1.elb.amazonaws.com.
elb052915-208107455.us-east-1.elb.amazonaws.com has address 174.129.206.210
elb052915-208107455.us-east-1.elb.amazonaws.com has address 54.225.175.188
elb052915-208107455.us-east-1.elb.amazonaws.com has address 54.235.77.9
Host elb052915-208107455.us-east-1.elb.amazonaws.com not found: 3(NXDOMAIN)
Host elb052915-208107455.us-east-1.elb.amazonaws.com not found: 3(NXDOMAIN)

ah, there’s the problem. You see, they have a CNAME which points to a CNAME which points to 5 names, only 3 of which resolve. So whenever I resolve it my browser might work, or might not. No error is shown since this is all AJAX (its done in teh background asynchronously by Javascript, the A and J are Asynch and JavaScript).

Lovely. Very consumer friendly 🙂

Tagged with: , ,